Changeset 4367
- Timestamp:
- 05/17/08 01:20:33 (8 months ago)
- Files:
-
- 1 modified
-
branches/0.11/lib/Doctrine/Import/Schema.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Import/Schema.php
r4333 r4367 325 325 326 326 foreach ($array as $className => $table) { 327 $this->_validateSchemaElement('root', array_keys($table) );327 $this->_validateSchemaElement('root', array_keys($table), $className); 328 328 329 329 $columns = array(); … … 359 359 } 360 360 361 $this->_validateSchemaElement('column', array_keys($field));362 363 361 $colDesc = array(); 364 362 if (isset($field['name'])) { … … 367 365 $colDesc['name'] = $columnName; 368 366 } 367 368 $this->_validateSchemaElement('column', array_keys($field), $className . '->columns->' . $colDesc['name']); 369 369 370 370 // Support short type(length) syntax: my_column: { type: integer(4) } … … 436 436 foreach ($array as $className => $definition) { 437 437 if ( ! empty($array[$className]['inheritance'])) { 438 $this->_validateSchemaElement('inheritance', array_keys($definition['inheritance']) );438 $this->_validateSchemaElement('inheritance', array_keys($definition['inheritance']), $className . '->inheritance'); 439 439 440 440 // Default inheritance to concrete inheritance … … 556 556 $relation['key'] = $this->_buildUniqueRelationKey($relation); 557 557 558 $this->_validateSchemaElement('relation', array_keys($relation) );558 $this->_validateSchemaElement('relation', array_keys($relation), $className . '->relation->' . $relation['alias']); 559 559 560 560 $this->_relations[$className][$alias] = $relation; … … 673 673 * @return void 674 674 */ 675 protected function _validateSchemaElement($name, $element )675 protected function _validateSchemaElement($name, $element, $path) 676 676 { 677 677 $element = (array) $element; … … 689 689 foreach ($element as $key => $value) { 690 690 if ( ! isset($validation[$value])) { 691 throw new Doctrine_Import_Exception('Invalid schema element named "' . $value . '"'); 691 throw new Doctrine_Import_Exception(sprintf('Invalid schema element named "' . $value . '" 692 at path "' . $path . '"')); 692 693 } 693 694 }