/** * Get root nodes * @return array */ public function getRootNodes() { $filter = new DoctrineSearchCondition(); $filter->levelEqualsTo(0); $order = new DoctrineSelectOrder(); $order->byLeftAscending(); $rootNodes = $this->nestedSetRepository->search($filter, $order); return $rootNodes; }