Changeset 4308
- Timestamp:
- 04/30/08 16:05:28 (14 months ago)
- Location:
- branches/0.11
- Files:
-
- 4 modified
-
lib/Doctrine/Import/Builder.php (modified) (1 diff)
-
lib/Doctrine/Import/Schema.php (modified) (2 diffs)
-
tests/Import/SchemaTestCase.php (modified) (2 diffs)
-
tests/schema.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Import/Builder.php
r4301 r4308 497 497 $build = null; 498 498 foreach ($columns as $name => $column) { 499 $build .= " ".'$this->hasColumn(\'' . $name . '\', \'' . $column['type'] . '\''; 499 $columnName = isset($column['name']) ? $column['name']:$name; 500 $build .= " ".'$this->hasColumn(\'' . $columnName . '\', \'' . $column['type'] . '\''; 500 501 501 502 if ($column['length']) { -
branches/0.11/lib/Doctrine/Import/Schema.php
r4301 r4308 361 361 362 362 $colDesc = array(); 363 $colDesc['name'] = $columnName; 363 if (isset($field['name'])) { 364 $colDesc['name'] = $field['name']; 365 } else { 366 $colDesc['name'] = $columnName; 367 } 364 368 365 369 // Support short type(length) syntax: my_column: { type: integer(4) } … … 390 394 } 391 395 392 $columns[(string) $col Desc['name']] = $colDesc;396 $columns[(string) $columnName] = $colDesc; 393 397 } 394 398 } -
branches/0.11/tests/Import/SchemaTestCase.php
r3961 r4308 51 51 } 52 52 53 $this->assertEqual(Doctrine::getTable('AliasTest')->getFieldName('test_col'), 'test_col_alias'); 54 53 55 Doctrine_Lib::removeDirectories($path); 54 56 } … … 75 77 $this->assertTrue(array_key_exists('detect_relations', $model) && is_bool($model['detect_relations'])); 76 78 $this->assertTrue(array_key_exists('generate_accessors', $model) && is_bool($model['generate_accessors'])); 79 $this->assertEqual($array['AliasTest']['columns']['test_col']['name'], 'test_col as test_col_alias'); 77 80 } 78 81 -
branches/0.11/tests/schema.yml
r3966 r4308 142 142 title: string(255) 143 143 description: string(255) 144 145 AliasTest: 146 columns: 147 test_col: 148 name: test_col as test_col_alias 149 type: string(255)