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

validateAndCompleteAssociationMapping() protected method

protected validateAndCompleteAssociationMapping ( $mapping, ClassMetadata $inherited = null, $phpcrLabel = 'property' )
$inherited ClassMetadata
    protected function validateAndCompleteAssociationMapping($mapping, ClassMetadata $inherited = null, $phpcrLabel = 'property')
    {
        $mapping = $this->validateAndCompleteFieldMapping($mapping, $inherited, false, $phpcrLabel);
        if ($inherited) {
            return $mapping;
        }
        $mapping['sourceDocument'] = $this->name;
        if (isset($mapping['targetDocument'])) {
            $mapping['targetDocument'] = $this->fullyQualifiedClassName($mapping['targetDocument']);
        }
        if (empty($mapping['strategy'])) {
            $mapping['strategy'] = 'weak';
        } elseif (!in_array($mapping['strategy'], array(null, 'weak', 'hard', 'path'))) {
            throw new MappingException("The attribute 'strategy' for the '" . $this->name . "' association has to be either a null, 'weak', 'hard' or 'path': " . $mapping['strategy']);
        }
        if (empty($mapping['cascade'])) {
            $mapping['cascade'] = 0;
        }
        $this->mappings[$mapping['fieldName']] = $mapping;
        return $mapping;
    }
ClassMetadata