Neos.ContentRepository/Classes/Domain/Repository/NodeDataRepository.php
protected function buildQueryBuilderForRelationMap($relationMap)
    {
        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->entityManager->createQueryBuilder();

        $queryBuilder->select('n')
            ->from(NodeData::class, 'n');

        $constraints = [];
        $parameters = [];

        foreach ($relationMap as $relatedObjectType => $relatedIdentifiers) {
            foreach ($relatedIdentifiers as $relatedIdentifier) {
                // entity references like "__identifier": "so-me-uu-id"
                $constraints[] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :entity' . md5($relatedIdentifier) . ' )';
                $parameters['entity' . md5($relatedIdentifier)] = '%"__identifier": "' . strtolower($relatedIdentifier) . '"%';

                // asset references in text like "asset://so-me-uu-id"
                $constraints[] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :asset' . md5($relatedIdentifier) . ' )';
                switch ($this->entityManager->getConnection()->getDatabasePlatform()->getName()) {
                    case 'postgresql':
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset://' . strtolower($relatedIdentifier) . '%';
                    break;
                    case 'sqlite':
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset:\/\/' . strtolower($relatedIdentifier) . '%';
                    break;
                    default:
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset:\\\\/\\\\/' . strtolower($relatedIdentifier) . '%';
                }
            }
        }

        $queryBuilder->where(implode(' OR ', $constraints));
        $queryBuilder->setParameters($parameters);
        return $queryBuilder;
    }
protected function buildQueryBuilderForRelationMap($relationMap)
    {
        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->entityManager->createQueryBuilder();

        $queryBuilder->select('n')
            ->from(NodeData::class, 'n');

        $constraints = [];
        $parameters = [];

        foreach ($relationMap as $relatedObjectType => $relatedIdentifiers) {
            foreach ($relatedIdentifiers as $relatedIdentifier) {
                // entity references like "__identifier": "so-me-uu-id"
                $constraints[] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :entity' . md5($relatedIdentifier) . ' )';
                $parameters['entity' . md5($relatedIdentifier)] = '%"__identifier": "' . strtolower($relatedIdentifier) . '"%';

                // asset references in text like "asset://so-me-uu-id"
                $constraints[] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :asset' . md5($relatedIdentifier) . ' )';
                switch ($this->entityManager->getConnection()->getDatabasePlatform()->getName()) {
                    case 'postgresql':
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset://' . strtolower($relatedIdentifier) . '%';
                    break;
                    case 'sqlite':
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset:\/\/' . strtolower($relatedIdentifier) . '%';
                    break;
                    default:
                        $parameters['asset' . md5($relatedIdentifier)] = '%asset:\\\\/\\\\/' . strtolower($relatedIdentifier) . '%';
                }
            }
        }

        $queryBuilder->where(implode(' OR ', $constraints));
        $queryBuilder->setParameters($parameters);
        return $queryBuilder;
    }
protected function buildQueryBuilderForRelationMap ( $ relationMap ) { /** @var QueryBuilder $queryBuilder */ $ queryBuilder = $ this -> entityManager -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 'n' ) -> from ( NodeData :: class , 'n' ) ; $ constraints = [ ] ; $ parameters = [ ] ; foreach ( $ relationMap as $ relatedObjectType => $ relatedIdentifiers ) { foreach ( $ relatedIdentifiers as $ relatedIdentifier ) { // entity references like "__identifier": "so-me-uu-id" $ constraints [ ] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :entity' . md5 ( $ relatedIdentifier ) . ' )' ; $ parameters [ 'entity' . md5 ( $ relatedIdentifier ) ] = '%"__identifier": "' . strtolower ( $ relatedIdentifier ) . '"%' ; // asset references in text like "asset://so-me-uu-id" $ constraints [ ] = '(LOWER(NEOSCR_TOSTRING(n.properties)) LIKE :asset' . md5 ( $ relatedIdentifier ) . ' )' ; switch ( $ this -> entityManager -> getConnection ( ) -> getDatabasePlatform ( ) -> getName ( ) ) { case 'postgresql' : $ parameters [ 'asset' . md5 ( $ relatedIdentifier ) ] = '%asset://' . strtolower ( $ relatedIdentifier ) . '%' ; break ; case 'sqlite' : $ parameters [ 'asset' . md5 ( $ relatedIdentifier ) ] = '%asset:\/\/' . strtolower ( $ relatedIdentifier ) . '%' ; break ; default : $ parameters [ 'asset' . md5 ( $ relatedIdentifier ) ] = '%asset:\\\\/\\\\/' . strtolower ( $ relatedIdentifier ) . '%' ; } } } $ queryBuilder -> where ( implode ( ' OR ' , $ constraints ) ) ; $ queryBuilder -> setParameters ( $ parameters ) ; return $ queryBuilder ; }
Returns a query builder for a query on node data using the given
relation map.

$objectTypeMap = [
'Neos\Media\Domain\Model\Asset' => ['some-uuid-here'],
'Neos\Media\Domain\Model\ImageVariant' => ['some-uuid-here', 'another-uuid-here']
]

@param array $relationMap
@return QueryBuilder
Returns a query builder for a query on node data using the given relation map .