private function isAutocreatedProperty(ClassMetadata $class, $fieldName)
    {
        $field = $class->getFieldMapping($fieldName);
        if ('jcr:uuid' === $field['property']) {
            // jackrabbit at least does not identify this as auto created
            // it is strictly speaking no property
            return true;
        }
        $ntm = $this->session->getWorkspace()->getNodeTypeManager();
        $nodeType = $ntm->getNodeType($class->getNodeType());
        $propertyDefinitions = $nodeType->getPropertyDefinitions();
        foreach ($class->getMixins() as $mixinTypeName) {
            $nodeType = $ntm->getNodeType($mixinTypeName);
            $propertyDefinitions = array_merge($propertyDefinitions, $nodeType->getPropertyDefinitions());
        }

        foreach ($propertyDefinitions as $property) {
            if ($class->mappings[$fieldName]['property'] === $property->getName()
                && $property->isAutoCreated()
            ) {
                return true;
            }
        }

        return false;
    }
private function isAutocreatedProperty(ClassMetadata $class, $fieldName)
    {
        $field = $class->getFieldMapping($fieldName);
        if ('jcr:uuid' === $field['property']) {
            // jackrabbit at least does not identify this as auto created
            // it is strictly speaking no property
            return true;
        }
        $ntm = $this->session->getWorkspace()->getNodeTypeManager();
        $nodeType = $ntm->getNodeType($class->getNodeType());
        $propertyDefinitions = $nodeType->getPropertyDefinitions();
        foreach ($class->getMixins() as $mixinTypeName) {
            $nodeType = $ntm->getNodeType($mixinTypeName);
            $propertyDefinitions = array_merge($propertyDefinitions, $nodeType->getPropertyDefinitions());
        }

        foreach ($propertyDefinitions as $property) {
            if ($class->mappings[$fieldName]['property'] === $property->getName()
                && $property->isAutoCreated()
            ) {
                return true;
            }
        }

        return false;
    }
private function isAutocreatedProperty ( ClassMetadata $ class , $ fieldName ) { $ field = $ class -> getFieldMapping ( $ fieldName ) ; if ( 'jcr:uuid' === $ field [ 'property' ] ) { // jackrabbit at least does not identify this as auto created // it is strictly speaking no property return true ; } $ ntm = $ this -> session -> getWorkspace ( ) -> getNodeTypeManager ( ) ; $ nodeType = $ ntm -> getNodeType ( $ class -> getNodeType ( ) ) ; $ propertyDefinitions = $ nodeType -> getPropertyDefinitions ( ) ; foreach ( $ class -> getMixins ( ) as $ mixinTypeName ) { $ nodeType = $ ntm -> getNodeType ( $ mixinTypeName ) ; $ propertyDefinitions = array_merge ( $ propertyDefinitions , $ nodeType -> getPropertyDefinitions ( ) ) ; } foreach ( $ propertyDefinitions as $ property ) { if ( $ class -> mappings [ $ fieldName ] [ 'property' ] === $ property -> getName ( ) && $ property -> isAutoCreated ( ) ) { return true ; } } return false ; }
Identify whether a PHPCR property is autocreated or not.

@param ClassMetadata $class
@param string        $fieldName

@return bool
Identify whether a PHPCR property is autocreated or not .