本文整理汇总了PHP中Doctrine\ORM\Mapping\MappingException::duplicateAssociationMapping方法的典型用法代码示例。如果您正苦于以下问题:PHP MappingException::duplicateAssociationMapping方法的具体用法?PHP MappingException::duplicateAssociationMapping怎么用?PHP MappingException::duplicateAssociationMapping使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doctrine\ORM\Mapping\MappingException
的用法示例。
在下文中一共展示了MappingException::duplicateAssociationMapping方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addInheritedAssociationMapping
/**
* INTERNAL:
* Adds an association mapping without completing/validating it.
* This is mainly used to add inherited association mappings to derived classes.
*
* @param array $mapping
* @throws MappingException
* @return void
*/
public function addInheritedAssociationMapping(array $mapping)
{
if (isset($this->associationMappings[$mapping['fieldName']])) {
throw MappingException::duplicateAssociationMapping($this->name, $mapping['fieldName']);
}
$this->associationMappings[$mapping['fieldName']] = $mapping;
}
示例2: addInheritedAssociationMapping
/**
* INTERNAL:
* Adds an association mapping without completing/validating it.
* This is mainly used to add inherited association mappings to derived classes.
*
* @param AssociationMapping $mapping
* @param string $owningClassName The name of the class that defined this mapping.
*/
public function addInheritedAssociationMapping(AssociationMapping $mapping)
{
if (isset($this->associationMappings[$mapping->sourceFieldName])) {
throw MappingException::duplicateAssociationMapping($this->name, $mapping->sourceFieldName);
}
$this->associationMappings[$mapping->sourceFieldName] = $mapping;
}