src/Sulu/Bundle/MediaBundle/Entity/FileVersionMetaRepository.php
public function getQueryBuilderWithoutSecurity(QueryBuilder $queryBuilder)
    {
        $queryBuilder->addSelect('fileVersion')
            ->addSelect('file')
            ->addSelect('media')
            ->addSelect('collection')
            ->leftJoin('d.fileVersion', 'fileVersion')
            ->leftJoin('fileVersion.file', 'file')
            ->leftJoin('file.media', 'media')
            ->leftJoin('media.collection', 'collection')
            ->leftJoin(
                AccessControl::class,
                'accessControl',
                'WITH',
                'accessControl.entityClass = :entityClass AND accessControl.entityId = collection.id'
            )
            ->where('file.version = fileVersion.version')
            ->andWhere('accessControl.id is null')
            ->setParameter('entityClass', Collection::class);

        return $queryBuilder;
    }
public function getQueryBuilderWithoutSecurity(QueryBuilder $queryBuilder)
    {
        $queryBuilder->addSelect('fileVersion')
            ->addSelect('file')
            ->addSelect('media')
            ->addSelect('collection')
            ->leftJoin('d.fileVersion', 'fileVersion')
            ->leftJoin('fileVersion.file', 'file')
            ->leftJoin('file.media', 'media')
            ->leftJoin('media.collection', 'collection')
            ->leftJoin(
                AccessControl::class,
                'accessControl',
                'WITH',
                'accessControl.entityClass = :entityClass AND accessControl.entityId = collection.id'
            )
            ->where('file.version = fileVersion.version')
            ->andWhere('accessControl.id is null')
            ->setParameter('entityClass', Collection::class);

        return $queryBuilder;
    }
public function getQueryBuilderWithoutSecurity ( QueryBuilder $ queryBuilder ) { $ queryBuilder -> addSelect ( 'fileVersion' ) -> addSelect ( 'file' ) -> addSelect ( 'media' ) -> addSelect ( 'collection' ) -> leftJoin ( 'd.fileVersion' , 'fileVersion' ) -> leftJoin ( 'fileVersion.file' , 'file' ) -> leftJoin ( 'file.media' , 'media' ) -> leftJoin ( 'media.collection' , 'collection' ) -> leftJoin ( AccessControl :: class , 'accessControl' , 'WITH' , 'accessControl.entityClass = :entityClass AND accessControl.entityId = collection.id' ) -> where ( 'file.version = fileVersion.version' ) -> andWhere ( 'accessControl.id is null' ) -> setParameter ( 'entityClass' , Collection :: class ) ; return $ queryBuilder ; }
Returns query-builder to find file-version-meta without permissions.

@param QueryBuilder $queryBuilder

@return QueryBuilder
Returns query - builder to find file - version - meta without permissions .