Changeset 2915 for trunk/system/libraries/ORM.php
- Timestamp:
- 06/25/2008 06:16:17 PM (5 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/ORM.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/ORM.php
r2899 r2915 292 292 { 293 293 // Make a find_related call 294 return $this->call_find_related( $method, $args);295 } 296 297 if (preg_match('/^(has|add|remove)_(.+) /', $method, $matches))294 return $this->call_find_related(substr($method, 13), $args); 295 } 296 297 if (preg_match('/^(has|add|remove)_(.+)$/', $method, $matches)) 298 298 { 299 299 if (empty($this->object->id)) … … 423 423 * @return object 424 424 */ 425 protected function call_find_related($method, $args) 426 { 427 // Extract table name 428 $table = substr($method, 13); 429 425 protected function call_find_related($table, $args) 426 { 430 427 // Construct a new model 431 428 $model = $this->load_model($table); … … 485 482 { 486 483 $action = $matches[1]; 487 $model = is_object(current($args)) ? current($args): $this->load_model($matches[2]);484 $model = (count($args) > 0 AND is_object($args[0])) ? $args[0] : $this->load_model($matches[2]); 488 485 489 486 // Real foreign table name
