public function checkNodeTypeMappings(DocumentManagerInterface $documentManager)
    {
        $knownNodeTypes = [];
        $debugInformation = [];
        $allMetadata = $documentManager->getMetadataFactory()->getAllMetadata();

        foreach ($allMetadata as $classMetadata) {
            if ($classMetadata->hasUniqueNodeType() && isset($knownNodeTypes[$classMetadata->getNodeType()])) {
                throw new MappingException(sprintf(
                    'The class "%s" is mapped with uniqueNodeType set to true, but the node type "%s" is used by "%s" as well.',
                    $classMetadata->name,
                    $classMetadata->getNodeType(),
                    $knownNodeTypes[$classMetadata->getNodeType()]
                ));
            }

            $knownNodeTypes[$classMetadata->getNodeType()] = $classMetadata->name;

            $debugInformation[$classMetadata->name] = [
                'unique_node_type' => $classMetadata->hasUniqueNodeType(),
                'node_type'        => $classMetadata->getNodeType(),
            ];
        }

        return $debugInformation;
    }
public function checkNodeTypeMappings(DocumentManagerInterface $documentManager)
    {
        $knownNodeTypes = [];
        $debugInformation = [];
        $allMetadata = $documentManager->getMetadataFactory()->getAllMetadata();

        foreach ($allMetadata as $classMetadata) {
            if ($classMetadata->hasUniqueNodeType() && isset($knownNodeTypes[$classMetadata->getNodeType()])) {
                throw new MappingException(sprintf(
                    'The class "%s" is mapped with uniqueNodeType set to true, but the node type "%s" is used by "%s" as well.',
                    $classMetadata->name,
                    $classMetadata->getNodeType(),
                    $knownNodeTypes[$classMetadata->getNodeType()]
                ));
            }

            $knownNodeTypes[$classMetadata->getNodeType()] = $classMetadata->name;

            $debugInformation[$classMetadata->name] = [
                'unique_node_type' => $classMetadata->hasUniqueNodeType(),
                'node_type'        => $classMetadata->getNodeType(),
            ];
        }

        return $debugInformation;
    }
public function checkNodeTypeMappings ( DocumentManagerInterface $ documentManager ) { $ knownNodeTypes = [ ] ; $ debugInformation = [ ] ; $ allMetadata = $ documentManager -> getMetadataFactory ( ) -> getAllMetadata ( ) ; foreach ( $ allMetadata as $ classMetadata ) { if ( $ classMetadata -> hasUniqueNodeType ( ) && isset ( $ knownNodeTypes [ $ classMetadata -> getNodeType ( ) ] ) ) { throw new MappingException ( sprintf ( 'The class "%s" is mapped with uniqueNodeType set to true, but the node type "%s" is used by "%s" as well.' , $ classMetadata -> name , $ classMetadata -> getNodeType ( ) , $ knownNodeTypes [ $ classMetadata -> getNodeType ( ) ] ) ) ; } $ knownNodeTypes [ $ classMetadata -> getNodeType ( ) ] = $ classMetadata -> name ; $ debugInformation [ $ classMetadata -> name ] = [ 'unique_node_type' => $ classMetadata -> hasUniqueNodeType ( ) , 'node_type' => $ classMetadata -> getNodeType ( ) , ] ; } return $ debugInformation ; }
Check each mapped PHPCR-ODM document for the given document manager,
throwing an exception if any document is set to use a unique node
type but the node type is re-used. Returns an array of debug information.

@param DocumentManagerInterface $documentManager The document manager to check mappings for.

@throws MappingException

@return array
Check each mapped PHPCR - ODM document for the given document manager throwing an exception if any document is set to use a unique node type but the node type is re - used . Returns an array of debug information .