Doctrine\ODM\PHPCR\Mapping\Driver\YamlDriver::addMappingFromReference PHP Метод

addMappingFromReference() приватный Метод

private addMappingFromReference ( Doctrine\Common\Persistence\Mapping\ClassMetadata $class, $fieldName, $reference, $type )
$class Doctrine\Common\Persistence\Mapping\ClassMetadata
    private function addMappingFromReference(ClassMetadata $class, $fieldName, $reference, $type)
    {
        /** @var $class \Doctrine\ODM\PHPCR\Mapping\ClassMetadata */
        $mapping = array_merge(array('fieldName' => $fieldName), $reference);
        $mapping['cascade'] = isset($reference['cascade']) ? $this->getCascadeMode($reference['cascade']) : 0;
        $mapping['name'] = isset($reference['name']) ? $reference['name'] : null;
        if (!isset($mapping['targetDocument'])) {
            $mapping['targetDocument'] = null;
        }
        if ($type === 'many') {
            $class->mapManyToMany($mapping);
        } elseif ($type === 'one') {
            $class->mapManyToOne($mapping);
        }
    }