Gedmo Tree getPath Error: Node is not related to this repository 500 Internal Server Error - InvalidArgumentException

后端 未结 1 1309
醉梦人生
醉梦人生 2021-01-28 09:57

I am getting error:

Node is not related to this repository
500 Internal Server Error - InvalidArgumentException

UPDATE 1: it does not matter if

1条回答
  •  南方客
    南方客 (楼主)
    2021-01-28 10:18

    Got it working!

    Here are the needed changes:

    instead of

    nodeDecorator' => function($node) use ($repo)
    {
        return ''. $node['title'] .'';
    }
    

    one should write

    'nodeDecorator' => function($node) use ($repo)
    {
        return ''. $node['title'] .'';
    }
    

    and in Category class add

    public function __toString()
    {
        return $this->getTitle();
    }
    

    That is it, path to each node now should be showing.

    0 讨论(0)
提交回复
热议问题