Changeset 4792 for trunk/lib/Doctrine
- Timestamp:
- 08/22/08 10:37:03 (5 months ago)
- Location:
- trunk/lib/Doctrine
- Files:
-
- 2 modified
-
Association/OneToMany.php (modified) (1 diff)
-
MappingException.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Doctrine/Association/OneToMany.php
r4789 r4792 69 69 70 70 /** 71 * Validates and completed the mapping. 72 * 73 * @param array $mapping The mapping to validate and complete. 74 * @return array The validated and completed mapping. 75 * @override 76 */ 77 protected function _validateAndCompleteMapping(array $mapping) 78 { 79 $mapping = parent::_validateAndCompleteMapping($mapping); 80 // one-side MUST be inverse (must have mappedBy) 81 if ( ! isset($mapping['mappedBy'])) { 82 throw Doctrine_MappingException::oneToManyRequiresMappedBy($mapping['fieldName']); 83 } 84 85 return $mapping; 86 } 87 88 /** 71 89 * Whether orphaned elements (removed from the collection) should be deleted. 72 90 * -
trunk/lib/Doctrine/MappingException.php
r4776 r4792 48 48 return new self("No mapping found for field '$fieldName'."); 49 49 } 50 51 public static function oneToManyRequiresMappedBy($fieldName) 52 { 53 return new self("OneToMany mapping on field '$fieldName' requires the 'mappedBy' attribute."); 54 } 50 55 } 51 56