concrete/src/Entity/Statistics/UsageTracker/FileUsageRepository.php
public function findByCollection($collection, $version = null)
    {
        if ($collection instanceof Collection) {
            $collection = $collection->getCollectionID();
        }

        $criteria = [
            'collection_id' => $collection
        ];

        if ($version && $version instanceof Version) {
            $version = $version->getVersionID();
        }

        if ($version) {
            $criteria['collection_version_id'] = $version;
        }

        return $this->findBy($criteria);
    }
public function findByCollection($collection, $version = null)
    {
        if ($collection instanceof Collection) {
            $collection = $collection->getCollectionID();
        }

        $criteria = [
            'collection_id' => $collection
        ];

        if ($version && $version instanceof Version) {
            $version = $version->getVersionID();
        }

        if ($version) {
            $criteria['collection_version_id'] = $version;
        }

        return $this->findBy($criteria);
    }
public function findByCollection ( $ collection , $ version = null ) { if ( $ collection instanceof Collection ) { $ collection = $ collection -> getCollectionID ( ) ; } $ criteria = [ 'collection_id' => $ collection ] ; if ( $ version && $ version instanceof Version ) { $ version = $ version -> getVersionID ( ) ; } if ( $ version ) { $ criteria [ 'collection_version_id' ] = $ version ; } return $ this -> findBy ( $ criteria ) ; }
Find FileUsageRecords given a collection and a version
@param Collection|int $collection A collection or a collection ID
@param Version|int|null $version The version, a version ID, or null
@return \Concrete\Core\Entity\Statistics\UsageTracker\FileUsageRecord[]
Find FileUsageRecords given a collection and a version