Sulu\Bundle\MediaBundle\Entity\CollectionRepository::count PHP Method

count() public method

public count ( $depth, $filter = [], Sulu\Bundle\MediaBundle\Entity\CollectionInterface $collection = null )
$collection Sulu\Bundle\MediaBundle\Entity\CollectionInterface
    public function count($depth = 0, $filter = [], CollectionInterface $collection = null)
    {
        $ids = $this->getIdsQuery($depth, $filter, [], $collection, 'DISTINCT collection.id')->getScalarResult();
        try {
            return count($ids);
        } catch (NoResultException $e) {
            return;
        }
    }