Sulu\Bundle\CategoryBundle\Entity\CategoryRepositoryInterface::findChildrenCategoriesByParentId PHP Method

findChildrenCategoriesByParentId() public method

If parentId is set, only the sub-graph below the category which is assigned to the given id is returned.
public findChildrenCategoriesByParentId ( null $parentId = null ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
$parentId null
return Sulu\Bundle\CategoryBundle\Entity\CategoryInterface[]
    public function findChildrenCategoriesByParentId($parentId = null);

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function findChildrenByParentId($parentId = null)
 {
     if ($parentId && !$this->categoryRepository->isCategoryId($parentId)) {
         throw new CategoryIdNotFoundException($parentId);
     }
     return $this->categoryRepository->findChildrenCategoriesByParentId($parentId);
 }