在我的专业实体中,我想用连接列联接 al 列并显示来自专门性的行,但我收到错误: 对象提供给转义助手,但标志不允许递归
在专业实体中:
/**
* @ORMOneToOne(targetEntity="UserEntityUser")
* @ORMJoinColumn(name="user_id", referencedColumnName="id")
*/
private $fullname;
//...
/**
* Returns fullname.
* @return string
*/
public function getFullName()
{
return $this->fullname;
}
在控制器中:
public function indexAction()
{
//Array met alle user samenstellen
$users = $this->entityManager->getRepository(Specialisme::class)->findBy([], ['id'=>'ASC']);
//Users doorgeven aan view model
return new ViewModel([
'users' => $users
]);
return new ViewModel();
}
视图:
<tr>
<th>Naam</th>
<th>Specialisme</th>
<th>Sub-specialisme</th>
</tr>
<?php foreach ($users as $user): ?>
<tr>
<td>f</td>
<td><?= $this->escapeHtml($user->getId()); ?></td>
<td><?= $this->escapeHtml($user->getFullName()); ?></td>
</tr>
<?php endforeach; ?>
它返回对象,所以我必须使用引用对象的方法:
$user->getBeschikbaarheid((->getOpZoekNaar(((;