Doctrine\ODM\PHPCR\Mapping\ClassMetadata::isInheritedField PHP Method

isInheritedField() public method

Checks whether a mapped field is inherited from an entity superclass.
public isInheritedField ( $fieldName ) : boolean
return boolean string class name if the field is inherited, FALSE otherwise.
    public function isInheritedField($fieldName)
    {
        return isset($this->inheritedFields[$fieldName]) ? $this->inheritedFields[$fieldName] : false;
    }

Usage Example

 private function registerParentOnField(ClassMetadata $subClass, ClassMetadata $parentClass, $fieldName)
 {
     if (!$parentClass->isInheritedField($fieldName) && !$parentClass->isMappedSuperclass) {
         $subClass->setFieldInherited($fieldName, $parentClass->name);
     }
     if (!$parentClass->isDeclaredField($fieldName)) {
         $subClass->setFieldDeclared($fieldName, $parentClass->name);
     }
 }
ClassMetadata