Neos.Media/Classes/Domain/Repository/AssetRepository.php
public function countByAssetCollection(AssetCollection $assetCollection)
    {
        $rsm = new ResultSetMapping();
        $rsm->addScalarResult('c', 'c');

        $queryString = "SELECT count(a.persistence_object_identifier) c FROM neos_media_domain_model_asset a LEFT JOIN neos_media_domain_model_assetcollection_assets_join collectionmm ON a.persistence_object_identifier = collectionmm.media_asset WHERE collectionmm.media_assetcollection = ? AND a.dtype != 'neos_media_imagevariant'";

        $query = $this->entityManager->createNativeQuery($queryString, $rsm);
        $query->setParameter(1, $assetCollection);
        try {
            return $query->getSingleScalarResult();
        } catch (NonUniqueResultException $e) {
            return 0;
        }
    }
public function countByAssetCollection(AssetCollection $assetCollection)
    {
        $rsm = new ResultSetMapping();
        $rsm->addScalarResult('c', 'c');

        $queryString = "SELECT count(a.persistence_object_identifier) c FROM neos_media_domain_model_asset a LEFT JOIN neos_media_domain_model_assetcollection_assets_join collectionmm ON a.persistence_object_identifier = collectionmm.media_asset WHERE collectionmm.media_assetcollection = ? AND a.dtype != 'neos_media_imagevariant'";

        $query = $this->entityManager->createNativeQuery($queryString, $rsm);
        $query->setParameter(1, $assetCollection);
        try {
            return $query->getSingleScalarResult();
        } catch (NonUniqueResultException $e) {
            return 0;
        }
    }
public function countByAssetCollection ( AssetCollection $ assetCollection ) { $ rsm = new ResultSetMapping ( ) ; $ rsm -> addScalarResult ( 'c' , 'c' ) ; $ queryString = "SELECT count(a.persistence_object_identifier) c FROM neos_media_domain_model_asset a LEFT JOIN neos_media_domain_model_assetcollection_assets_join collectionmm ON a.persistence_object_identifier = collectionmm.media_asset WHERE collectionmm.media_assetcollection = ? AND a.dtype != 'neos_media_imagevariant'" ; $ query = $ this -> entityManager -> createNativeQuery ( $ queryString , $ rsm ) ; $ query -> setParameter ( 1 , $ assetCollection ) ; try { return $ query -> getSingleScalarResult ( ) ; } catch ( NonUniqueResultException $ e ) { return 0 ; } }
Count assets by asset collection

@param AssetCollection $assetCollection
@return integer
Count assets by asset collection