Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface::findCollectionBreadcrumbById PHP Method

findCollectionBreadcrumbById() public method

Finds the breadcrumb of a collection with given id.
public findCollectionBreadcrumbById ( integer $id ) : Collection[]
$id integer
return Collection[]
    public function findCollectionBreadcrumbById($id);

Usage Example

Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getById($id, $locale, $depth = 0, $breadcrumb = false, $filter = [], $sortBy = [])
 {
     $collectionEntity = $this->collectionRepository->findCollectionById($id);
     if ($collectionEntity === null) {
         throw new CollectionNotFoundException($id);
     }
     $filter['locale'] = $locale;
     $collectionChildren = $this->collectionRepository->findCollectionSet($depth, $filter, $collectionEntity, $sortBy);
     $breadcrumbEntities = null;
     if ($breadcrumb) {
         $breadcrumbEntities = $this->collectionRepository->findCollectionBreadcrumbById($id);
     }
     return $this->getApiEntity($collectionEntity, $locale, $collectionChildren, $breadcrumbEntities);
 }