Changeset 4367

Show
Ignore:
Timestamp:
05/17/08 01:20:33 (8 months ago)
Author:
jwage
Message:

fixes #1042

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Import/Schema.php

    r4333 r4367  
    325325 
    326326        foreach ($array as $className => $table) { 
    327             $this->_validateSchemaElement('root', array_keys($table)); 
     327            $this->_validateSchemaElement('root', array_keys($table), $className); 
    328328 
    329329            $columns = array(); 
     
    359359                    } 
    360360 
    361                     $this->_validateSchemaElement('column', array_keys($field)); 
    362  
    363361                    $colDesc = array(); 
    364362                    if (isset($field['name'])) { 
     
    367365                        $colDesc['name'] = $columnName; 
    368366                    } 
     367 
     368                    $this->_validateSchemaElement('column', array_keys($field), $className . '->columns->' . $colDesc['name']); 
    369369 
    370370                    // Support short type(length) syntax: my_column: { type: integer(4) } 
     
    436436        foreach ($array as $className => $definition) { 
    437437            if ( ! empty($array[$className]['inheritance'])) { 
    438                 $this->_validateSchemaElement('inheritance', array_keys($definition['inheritance'])); 
     438                $this->_validateSchemaElement('inheritance', array_keys($definition['inheritance']), $className . '->inheritance'); 
    439439 
    440440                // Default inheritance to concrete inheritance 
     
    556556                $relation['key'] = $this->_buildUniqueRelationKey($relation); 
    557557                 
    558                 $this->_validateSchemaElement('relation', array_keys($relation)); 
     558                $this->_validateSchemaElement('relation', array_keys($relation), $className . '->relation->' . $relation['alias']); 
    559559                 
    560560                $this->_relations[$className][$alias] = $relation; 
     
    673673     * @return void 
    674674     */ 
    675     protected function _validateSchemaElement($name, $element) 
     675    protected function _validateSchemaElement($name, $element, $path) 
    676676    { 
    677677        $element = (array) $element; 
     
    689689        foreach ($element as $key => $value) { 
    690690            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 . '"')); 
    692693            } 
    693694        }