Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface::findCollectionSet PHP 메소드

findCollectionSet() 공개 메소드

Finds a collection set starting by given ID and depth.
public findCollectionSet ( integer $depth, array $filter = [], Sulu\Bundle\MediaBundle\Entity\CollectionInterface $collection = null, array $sortBy = [], Sulu\Component\Security\Authentication\UserInterface $user = null, integer $permission = null ) : Collection[]
$depth integer
$filter array
$collection Sulu\Bundle\MediaBundle\Entity\CollectionInterface
$sortBy array
$user Sulu\Component\Security\Authentication\UserInterface The user for which the additional access control should be checked
$permission integer The permission mask the user requires, if it is passed for the access control check
리턴 Collection[]
    public function findCollectionSet($depth = 0, $filter = [], CollectionInterface $collection = null, $sortBy = [], UserInterface $user = null, $permission = null);

Usage Example

예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function getTree($locale, $offset, $limit, $search, $depth = 0, $sortBy = [])
 {
     /** @var Paginator $collectionSet */
     $collectionSet = $this->collectionRepository->findCollectionSet($depth, ['offset' => $offset, 'limit' => $limit, 'search' => $search, 'locale' => $locale], null, $sortBy);
     $collections = [];
     /** @var CollectionEntity[] $entities */
     $entities = iterator_to_array($collectionSet);
     foreach ($entities as $entity) {
         if ($entity->getParent() === null) {
             $collections[] = $this->getApiEntity($entity, $locale, $entities);
         }
     }
     $this->count = $collectionSet->count();
     return $collections;
 }
All Usage Examples Of Sulu\Bundle\MediaBundle\Entity\CollectionRepositoryInterface::findCollectionSet