puse a funcionar el ejemplo de esta manera:
Código PHP:
Ver original$repo = $this->em->getRepository('Application\Entity\Menu');
$arrayTree = $repo->childrenHierarchy();
$this->render_nested_set($arrayTree);
......
private function render_nested_set($coll)
{
$output = "\n";
foreach ($coll as $key=>$record) {
$output .= "<li>".$record->getMenu();
if ($record->getChildren()!=null) {
$output .= "\n".$this->render_nested_set($record->getChildren());
}
$output .= "</li>\n";
}
return $output."</ul>\n";
}
y me dice:
Cita: Fatal error: Call to a member function getMenu() on a non-object in C:\xampp\htdocs\bcbtram\application\modules\defaul t\controllers\IndexController.php on line 233
y en mi modelo si existe public function getMenu() {...}.