Neos.ContentRepository/Classes/Command/NodeCommandControllerPlugin.php
protected function collectNodesWithInvalidDimensions($workspaceName, array $allowedDimensionCombinations)
    {
        $nodes = [];
        ksort($allowedDimensionCombinations);

        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->entityManager->createQueryBuilder();

        $queryBuilder->select('n')
            ->from(NodeData::class, 'n')
            ->where('n.workspace = :workspace')
            ->setParameter('workspace', $workspaceName);

        foreach ($queryBuilder->getQuery()->getArrayResult() as $nodeDataArray) {
            if ($nodeDataArray['dimensionValues'] === [] || $nodeDataArray['dimensionValues'] === '') {
                continue;
            }
            $foundValidDimensionValues = false;
            foreach ($allowedDimensionCombinations as $allowedDimensionConfiguration) {
                ksort($allowedDimensionConfiguration);
                ksort($nodeDataArray['dimensionValues']);
                foreach ($allowedDimensionConfiguration as $allowedDimensionKey => $allowedDimensionValuesArray) {
                    if (isset($nodeDataArray['dimensionValues'][$allowedDimensionKey]) && isset($nodeDataArray['dimensionValues'][$allowedDimensionKey][0])) {
                        $actualDimensionValue = $nodeDataArray['dimensionValues'][$allowedDimensionKey][0];
                        if (in_array($actualDimensionValue, $allowedDimensionValuesArray)) {
                            $foundValidDimensionValues = true;
                            break;
                        }
                    }
                }
            }

            if (!$foundValidDimensionValues) {
                $this->dispatch(self::EVENT_NOTICE, sprintf('Node <i>%s</i> has invalid dimension values: %s', $nodeDataArray['path'], json_encode($nodeDataArray['dimensionValues'])));
                $nodes[] = $nodeDataArray;
            }
        }
        return $nodes;
    }
protected function collectNodesWithInvalidDimensions($workspaceName, array $allowedDimensionCombinations)
    {
        $nodes = [];
        ksort($allowedDimensionCombinations);

        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->entityManager->createQueryBuilder();

        $queryBuilder->select('n')
            ->from(NodeData::class, 'n')
            ->where('n.workspace = :workspace')
            ->setParameter('workspace', $workspaceName);

        foreach ($queryBuilder->getQuery()->getArrayResult() as $nodeDataArray) {
            if ($nodeDataArray['dimensionValues'] === [] || $nodeDataArray['dimensionValues'] === '') {
                continue;
            }
            $foundValidDimensionValues = false;
            foreach ($allowedDimensionCombinations as $allowedDimensionConfiguration) {
                ksort($allowedDimensionConfiguration);
                ksort($nodeDataArray['dimensionValues']);
                foreach ($allowedDimensionConfiguration as $allowedDimensionKey => $allowedDimensionValuesArray) {
                    if (isset($nodeDataArray['dimensionValues'][$allowedDimensionKey]) && isset($nodeDataArray['dimensionValues'][$allowedDimensionKey][0])) {
                        $actualDimensionValue = $nodeDataArray['dimensionValues'][$allowedDimensionKey][0];
                        if (in_array($actualDimensionValue, $allowedDimensionValuesArray)) {
                            $foundValidDimensionValues = true;
                            break;
                        }
                    }
                }
            }

            if (!$foundValidDimensionValues) {
                $this->dispatch(self::EVENT_NOTICE, sprintf('Node <i>%s</i> has invalid dimension values: %s', $nodeDataArray['path'], json_encode($nodeDataArray['dimensionValues'])));
                $nodes[] = $nodeDataArray;
            }
        }
        return $nodes;
    }
protected function collectNodesWithInvalidDimensions ( $ workspaceName , array $ allowedDimensionCombinations ) { $ nodes = [ ] ; ksort ( $ allowedDimensionCombinations ) ; /** @var QueryBuilder $queryBuilder */ $ queryBuilder = $ this -> entityManager -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 'n' ) -> from ( NodeData :: class , 'n' ) -> where ( 'n.workspace = :workspace' ) -> setParameter ( 'workspace' , $ workspaceName ) ; foreach ( $ queryBuilder -> getQuery ( ) -> getArrayResult ( ) as $ nodeDataArray ) { if ( $ nodeDataArray [ 'dimensionValues' ] === [ ] || $ nodeDataArray [ 'dimensionValues' ] === '' ) { continue ; } $ foundValidDimensionValues = false ; foreach ( $ allowedDimensionCombinations as $ allowedDimensionConfiguration ) { ksort ( $ allowedDimensionConfiguration ) ; ksort ( $ nodeDataArray [ 'dimensionValues' ] ) ; foreach ( $ allowedDimensionConfiguration as $ allowedDimensionKey => $ allowedDimensionValuesArray ) { if ( isset ( $ nodeDataArray [ 'dimensionValues' ] [ $ allowedDimensionKey ] ) && isset ( $ nodeDataArray [ 'dimensionValues' ] [ $ allowedDimensionKey ] [ 0 ] ) ) { $ actualDimensionValue = $ nodeDataArray [ 'dimensionValues' ] [ $ allowedDimensionKey ] [ 0 ] ; if ( in_array ( $ actualDimensionValue , $ allowedDimensionValuesArray ) ) { $ foundValidDimensionValues = true ; break ; } } } } if ( ! $ foundValidDimensionValues ) { $ this -> dispatch ( self :: EVENT_NOTICE , sprintf ( 'Node <i>%s</i> has invalid dimension values: %s' , $ nodeDataArray [ 'path' ] , json_encode ( $ nodeDataArray [ 'dimensionValues' ] ) ) ) ; $ nodes [ ] = $ nodeDataArray ; } } return $ nodes ; }
Collects all nodes of the given node type which have dimension values not fitting to the current dimension
configuration.

@param string $workspaceName
@param array $allowedDimensionCombinations
@return array
Collects all nodes of the given node type which have dimension values not fitting to the current dimension configuration .