Changeset 4590
- Timestamp:
- 06/29/08 02:16:51 (12 months ago)
- Files:
-
- 1 modified
-
branches/0.11/lib/Doctrine/Import/Builder.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Import/Builder.php
r4556 r4590 424 424 public function buildSetUp(array $definition) 425 425 { 426 if (isset($definition['inheritance']['type']) && ($definition['inheritance']['type'] == 'simple')) {427 return;428 }429 430 426 $ret = array(); 431 427 $i = 0; 432 433 $ret[$i] = " parent::setUp();";434 $i++;435 428 436 429 if (isset($definition['relations']) && is_array($definition['relations']) && ! empty($definition['relations'])) { … … 508 501 $code = trim($code); 509 502 510 return PHP_EOL . ' public function setUp()' . PHP_EOL . ' {' . PHP_EOL . ' ' . $code . PHP_EOL . ' }'; 503 // If the body of the function has contents then we need to 504 if ($code) { 505 // If the body of the function has contents and we are using inheritance 506 // then we need call the parent::setUp() before the body of the function 507 if ($code && isset($definition['inheritance']['type'])) { 508 $code = "parent::setUp();" . PHP_EOL . ' ' . $code; 509 } 510 } 511 512 // If we have some code for the function then lets define it and return it 513 if ($code) { 514 return PHP_EOL . ' public function setUp()' . PHP_EOL . ' {' . PHP_EOL . ' ' . $code . PHP_EOL . ' }'; 515 } 511 516 } 512 517