/** * @param string $fieldName * @throws MappingException */ private function assertFieldNotMapped($fieldName) { if (isset($this->fieldMappings[$fieldName]) || isset($this->associationMappings[$fieldName]) || isset($this->embeddedClasses[$fieldName])) { throw MappingException::duplicateFieldMapping($this->name, $fieldName); } }
/** * Stores the association mapping. * * @param array $assocMapping * @throws MappingException * @return void */ protected function _storeAssociationMapping(array $assocMapping) { $sourceFieldName = $assocMapping['fieldName']; if (isset($this->fieldMappings[$sourceFieldName]) || isset($this->associationMappings[$sourceFieldName])) { throw MappingException::duplicateFieldMapping($this->name, $sourceFieldName); } $this->associationMappings[$sourceFieldName] = $assocMapping; }
/** * Stores the association mapping. * * @param AssociationMapping $assocMapping */ private function _storeAssociationMapping(AssociationMapping $assocMapping) { $sourceFieldName = $assocMapping->getSourceFieldName(); if (isset($this->associationMappings[$sourceFieldName])) { throw MappingException::duplicateFieldMapping(); } $this->associationMappings[$sourceFieldName] = $assocMapping; $this->_registerMappingIfInverse($assocMapping); // Store ReflectionProperty of mapped field $refProp = $this->reflClass->getProperty($sourceFieldName); $refProp->setAccessible(true); $this->reflFields[$sourceFieldName] = $refProp; }