Changeset 2300
- Timestamp:
- 03/13/2008 02:05:10 AM (10 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/ORM.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/ORM.php
r2299 r2300 498 498 { 499 499 // Find the many<>many relationship 500 return (bool) count 501 ( 502 self::$db 500 return (bool) self::$db 503 501 ->select($primary) 504 502 ->from($this->related_table($table)) 505 503 ->where($relationship) 506 504 ->limit(1) 507 ->get() 508 ); 505 ->get()->count(); 509 506 } 510 507 … … 515 512 { 516 513 // Attempt to delete the many<>many relationship 517 return (bool) count(self::$db->delete($this->related_table($table), $relationship));514 return (bool) self::$db->delete($this->related_table($table), $relationship)->count(); 518 515 } 519 516 elseif ($model->$primary === $this->object->id) … … 613 610 $query = self::$db->insert($this->table, $data); 614 611 615 if ( count($query) === 1)612 if ($query->count() === 1) 616 613 { 617 614 // Set current object id by the insert id … … 625 622 } 626 623 627 if ( count($query) === 1)624 if ($query->count() === 1) 628 625 { 629 626 // Reset changed data … … 676 673 677 674 // Return the number of rows deleted 678 return count(self::$db->delete($this->table, $where));675 return self::$db->delete($this->table, $where)->count(); 679 676 } 680 677
