Changeset 4460
- Timestamp:
- 06/01/08 07:41:27 (13 months ago)
- Location:
- branches/0.11
- Files:
-
- 2 added
- 3 modified
-
lib/Doctrine/Node.php (modified) (1 diff)
-
lib/Doctrine/Record/Abstract.php (modified) (1 diff)
-
tests/run.php (modified) (1 diff)
-
tests/Ticket/1099TestCase.php (added)
-
tests/Ticket/NewTicketTestCase.php (added)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Node.php
r3884 r4460 71 71 $this->options = $options; 72 72 73 // Make sure that the tree object of the root c omponentis used in the case74 // of column aggregation inheritance .73 // Make sure that the tree object of the root class is used in the case 74 // of column aggregation inheritance (single table inheritance). 75 75 $class = $record->getTable()->getComponentName(); 76 $table = $record->getTable(); 77 if ($table->getOption('inheritanceMap')) { 78 $subclasses = $table->getOption('subclasses'); 79 while (in_array($class, (array) $subclasses)) { 76 $thisTable = $record->getTable(); 77 $table = $thisTable; 78 if ($thisTable->getOption('inheritanceMap')) { 79 // Move up the hierarchy until we find the "subclasses" option. This option 80 // MUST be set on the root class of the user's hierarchy that uses STI. 81 while ( ! $subclasses = $table->getOption('subclasses')) { 80 82 $class = get_parent_class($class); 83 if ($class == 'Doctrine_Record') { 84 throw new Doctrine_Node_Exception("No subclasses specified. You are " 85 . "using Single Table Inheritance with NestedSet but you have " 86 . "not specified the subclasses correctly. Make sure you use " 87 . "setSubclasses() in the root class of your hierarchy."); 88 } 89 $table = $table->getConnection()->getTable($class); 81 90 } 82 91 } 83 if ($ class != $table->getComponentName()) {84 $this->_tree = $table->get Connection()->getTable($class)->getTree();92 if ($thisTable != $table) { 93 $this->_tree = $table->getTree(); 85 94 } else { 86 $this->_tree = $t able->getTree();95 $this->_tree = $thisTable->getTree(); 87 96 } 88 97 } -
branches/0.11/lib/Doctrine/Record/Abstract.php
r4316 r4460 132 132 return; 133 133 } 134 135 134 $this->_table->setOption('subclasses', array_keys($map)); 136 135 } -
branches/0.11/tests/run.php
r4439 r4460 46 46 $tickets->addTestCase(new Doctrine_Ticket_941_TestCase()); 47 47 $tickets->addTestCase(new Doctrine_Ticket_930_TestCase()); 48 $tickets->addTestCase(new Doctrine_Ticket_1099_TestCase()); 49 $tickets->addTestCase(new Doctrine_Ticket_NewTicket_TestCase()); 48 50 49 51 // Only uncomment the following ticket if you want to check free() performance!