I am getting error:
Node is not related to this repository
500 Internal Server Error - InvalidArgumentException
UPDATE 1: it does not matter if
Got it working!
Here are the needed changes:
instead of
nodeDecorator' => function($node) use ($repo)
{
return '<a href="/project_path/'. implode('/', $repo->getPath($node)) .'">'. $node['title'] .'</a>';
}
one should write
'nodeDecorator' => function($node) use ($repo)
{
return '<a href="/project_path/'. @implode('/', $repo->getPath($repo->findOneBy(array('id' => $node['id'])))) .'">'. $node['title'] .'</a>';
}
and in Category class add
public function __toString()
{
return $this->getTitle();
}
That is it, path to each node now should be showing.