public function findOneBySha1($sha1Hash)
    {
        $query = $this->createQuery();
        $query->matching($query->equals('sha1', $sha1Hash))->setLimit(1);
        /** @var PersistentResource $resource */
        $resource = $query->execute()->getFirst();
        if ($resource === null) {
            /** @var PersistentResource $importedResource */
            foreach ($this->addedResources as $importedResource) {
                if ($importedResource->getSha1() === $sha1Hash) {
                    return $importedResource;
                }
            }
        }

        return $resource;
    }
public function findOneBySha1($sha1Hash)
    {
        $query = $this->createQuery();
        $query->matching($query->equals('sha1', $sha1Hash))->setLimit(1);
        /** @var PersistentResource $resource */
        $resource = $query->execute()->getFirst();
        if ($resource === null) {
            /** @var PersistentResource $importedResource */
            foreach ($this->addedResources as $importedResource) {
                if ($importedResource->getSha1() === $sha1Hash) {
                    return $importedResource;
                }
            }
        }

        return $resource;
    }
public function findOneBySha1 ( $ sha1Hash ) { $ query = $ this -> createQuery ( ) ; $ query -> matching ( $ query -> equals ( 'sha1' , $ sha1Hash ) ) -> setLimit ( 1 ) ; /** @var PersistentResource $resource */ $ resource = $ query -> execute ( ) -> getFirst ( ) ; if ( $ resource === null ) { /** @var PersistentResource $importedResource */ foreach ( $ this -> addedResources as $ importedResource ) { if ( $ importedResource -> getSha1 ( ) === $ sha1Hash ) { return $ importedResource ; } } } return $ resource ; }
Find one resource by SHA1

@param string $sha1Hash
@return PersistentResource
Find one resource by SHA1