Show
Ignore:
Timestamp:
12/14/2007 12:52:49 PM (13 months ago)
Author:
Shadowhand
Message:

Updates to Auth/ORM:

  • User_Model no longer assumes that digit strings are usernames (fix to where_key)
  • Implemented many<>many deletion in ORM::delete()
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/ORM.php

    r1490 r1534  
    546546                                return FALSE; 
    547547 
     548                        if ( ! empty($this->has_any_belongs_to_many)) 
     549                        { 
     550                                // Foreign WHERE for this object 
     551                                $where = array($this->class.'_id' => $this->object->id); 
     552 
     553                                foreach($this->has_and_belongs_to_many as $table) 
     554                                { 
     555                                        // Delete all many<>many relationships for this object 
     556                                        self::$db->delete($this->table_name.'_'.$table, $where); 
     557                                } 
     558                        } 
     559 
    548560                        // WHERE for this object 
    549561                        $where = array('id' => $this->object->id);