public function addMissingProperty(MetaEntityInterface $metaEntity, RelationMetaPropertyInterface $property)
    {
        $inversedBy = $property->getInversedBy();
        $mappedBy = $property->getMappedBy();
        if ($newPropertyName = $mappedBy ?: $inversedBy) {
            $inversedType = MetaPropertyFactory::getInversedType($property->getOrmType());
            /** @var RelationMetaPropertyInterface $newProperty */
            $newProperty = $this->metaPropertyFactory->createMetaProperty(
                $metaEntity,
                $inversedType,
                $newPropertyName
            );
            $newProperty->setTargetEntity($property->getMetaEntity());
            if ($inversedBy) {
                $newProperty->setMappedBy($property->getName());
            } else {
                $newProperty->setInversedBy($property->getName());
            }
        }
    }
public function addMissingProperty(MetaEntityInterface $metaEntity, RelationMetaPropertyInterface $property)
    {
        $inversedBy = $property->getInversedBy();
        $mappedBy = $property->getMappedBy();
        if ($newPropertyName = $mappedBy ?: $inversedBy) {
            $inversedType = MetaPropertyFactory::getInversedType($property->getOrmType());
            /** @var RelationMetaPropertyInterface $newProperty */
            $newProperty = $this->metaPropertyFactory->createMetaProperty(
                $metaEntity,
                $inversedType,
                $newPropertyName
            );
            $newProperty->setTargetEntity($property->getMetaEntity());
            if ($inversedBy) {
                $newProperty->setMappedBy($property->getName());
            } else {
                $newProperty->setInversedBy($property->getName());
            }
        }
    }
public function addMissingProperty ( MetaEntityInterface $ metaEntity , RelationMetaPropertyInterface $ property ) { $ inversedBy = $ property -> getInversedBy ( ) ; $ mappedBy = $ property -> getMappedBy ( ) ; if ( $ newPropertyName = $ mappedBy ? : $ inversedBy ) { $ inversedType = MetaPropertyFactory :: getInversedType ( $ property -> getOrmType ( ) ) ; /** @var RelationMetaPropertyInterface $newProperty */ $ newProperty = $ this -> metaPropertyFactory -> createMetaProperty ( $ metaEntity , $ inversedType , $ newPropertyName ) ; $ newProperty -> setTargetEntity ( $ property -> getMetaEntity ( ) ) ; if ( $ inversedBy ) { $ newProperty -> setMappedBy ( $ property -> getName ( ) ) ; } else { $ newProperty -> setInversedBy ( $ property -> getName ( ) ) ; } } }
Adds missing field for inversedBy or mappedBy
Adds missing field for inversedBy or mappedBy