Changeset 3118
- Timestamp:
- 04/14/08 15:47:15 (3 months ago)
- Files:
-
- trunk/Solar/Sql/Model.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Solar/Sql/Model.php
r3117 r3118 1383 1383 1384 1384 // the record class we'll use 1385 $ class = null;1385 $record_class = null; 1386 1386 1387 1387 // look for an inheritance in relation to $data … … 1409 1409 1410 1410 // now we need the inherited record class. suppress exceptions. 1411 // note that $ class could still end up false, as we might not find1411 // note that $record_class could still end up false, as we might not find 1412 1412 // a related class in the hierarchy. 1413 $ class = $this->_stack->load($inherit . '_Record', false);1413 $record_class = $this->_stack->load($inherit . '_Record', false); 1414 1414 } 1415 1415 1416 1416 // even if inheritance failed, look for a model-specific record class 1417 if (! $ class) {1418 $ class = $this->_stack->load('Record', false);1417 if (! $record_class) { 1418 $record_class = $this->_stack->load('Record', false); 1419 1419 } 1420 1420 1421 1421 // final fallback: the default record class 1422 if (! $ class) {1423 $ class = $this->_record_class;1422 if (! $record_class) { 1423 $record_class = $this->_record_class; 1424 1424 } 1425 1425 1426 1426 // factory the appropriate record class, set the model for it, then 1427 1427 // load and return it. 1428 $record = Solar::factory($ class);1428 $record = Solar::factory($record_class); 1429 1429 $record->setModel($model); 1430 1430 $record->load($data);
