Changeset 4679
- Timestamp:
- 07/13/08 00:34:09 (5 months ago)
- Location:
- branches/1.0
- Files:
-
- 5 modified
-
docs/manual/de/schema-files.txt (modified) (3 diffs)
-
docs/manual/en/schema-files.txt (modified) (3 diffs)
-
lib/Doctrine/Import/Builder.php (modified) (2 diffs)
-
lib/Doctrine/Import/Schema.php (modified) (3 diffs)
-
tests/Import/SchemaTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/docs/manual/de/schema-files.txt
r4674 r4679 541 541 </code> 542 542 543 +++ Generate Accessors544 545 When the generate_accessors: true option is present in a schema file, it will generate propel orm style546 get and set accessors in the Base model definition. For example setFieldName() and getFieldName() would547 then be possible in your models.548 549 Example:550 <code type="yaml">551 ---552 generate_accessors: true553 554 User:555 columns:556 username:557 type: string(255)558 </code>559 560 543 +++ Column Aliases 561 544 … … 608 591 inheritance 609 592 detect_relations 610 generate_accessors611 593 612 594 <code type="yaml"> … … 618 600 package: User 619 601 detect_relations: true 620 generate_accessors: true621 602 622 603 User: -
branches/1.0/docs/manual/en/schema-files.txt
r4674 r4679 578 578 </code> 579 579 580 +++ Generate Accessors581 582 When the generate_accessors: true option is present in a schema file, it will generate propel orm style583 get and set accessors in the Base model definition. For example setFieldName() and getFieldName() would584 then be possible in your models.585 586 Example:587 <code type="yaml">588 ---589 generate_accessors: true590 591 User:592 columns:593 username:594 type: string(255)595 </code>596 597 580 +++ Column Aliases 598 581 … … 645 628 inheritance 646 629 detect_relations 647 generate_accessors648 630 649 631 <code type="yaml"> … … 655 637 package: User 656 638 detect_relations: true 657 generate_accessors: true658 639 659 640 User: -
branches/1.0/lib/Doctrine/Import/Builder.php
r4637 r4679 353 353 . '%s' . PHP_EOL 354 354 . '%s' . PHP_EOL 355 . '%s'356 355 . '}'; 357 356 } … … 885 884 } 886 885 887 if ( ! isset($definition['generate_accessors']) || !$definition['generate_accessors']) {888 $definition['generate_accessors'] = $this->generateAccessors();889 }890 891 $accessorsCode = (isset($definition['generate_accessors']) && $definition['generate_accessors'] === true) ? $this->buildAccessors($definition):null;892 893 886 $content = sprintf(self::$_tpl, $abstract, 894 887 $className, 895 888 $extends, 896 889 $tableDefinitionCode, 897 $setUpCode, 898 $accessorsCode); 890 $setUpCode); 899 891 900 892 return $content; -
branches/1.0/lib/Doctrine/Import/Schema.php
r4637 r4679 86 86 'inheritance', 87 87 'detect_relations', 88 'generate_accessors',89 88 'listeners'), 90 89 … … 293 292 'package' => null, 294 293 'inheritance' => array(), 295 'detect_relations' => false, 296 'generate_accessors' => false); 294 'detect_relations' => false); 297 295 298 296 $array = Doctrine_Parser::load($schema, $type); … … 307 305 'package', 308 306 'inheritance', 309 'detect_relations', 310 'generate_accessors'); 307 'detect_relations'); 311 308 312 309 // Loop over and build up all the global values and remove them from the array -
branches/1.0/tests/Import/SchemaTestCase.php
r4308 r4679 76 76 $this->assertTrue(array_key_exists('inheritance', $model) && is_array($model['inheritance'])); 77 77 $this->assertTrue(array_key_exists('detect_relations', $model) && is_bool($model['detect_relations'])); 78 $this->assertTrue(array_key_exists('generate_accessors', $model) && is_bool($model['generate_accessors']));79 78 $this->assertEqual($array['AliasTest']['columns']['test_col']['name'], 'test_col as test_col_alias'); 80 79 }