本文整理汇总了PHP中Doctrine\ORM\Mapping\MappingException::duplicateFieldMapping方法的典型用法代码示例。如果您正苦于以下问题:PHP MappingException::duplicateFieldMapping方法的具体用法?PHP MappingException::duplicateFieldMapping怎么用?PHP MappingException::duplicateFieldMapping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\Mapping\MappingException
的用法示例。
在下文中一共展示了MappingException::duplicateFieldMapping方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertFieldNotMapped
/**
* @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);
}
}
示例2: _storeAssociationMapping
/**
* 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;
}
示例3: _storeAssociationMapping
/**
* 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;
}