Changeset 293 for trunk/trax/vendor

Show
Ignore:
Timestamp:
12/08/07 10:52:36 (4 years ago)
Author:
john
Message:

unset association if belongs_to or has_one returns null so it can be call via set()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/active_record.php

    r283 r293  
    505505                    $parameters = is_array($this->has_one) ? $this->has_one[$key] : null; 
    506506                    $this->$key = $this->find_one_has_one($key, $parameters); 
     507                    if(is_null($this->$key)) unset($this->$key);                     
    507508                    break; 
    508509                case "belongs_to": 
    509510                    $parameters = is_array($this->belongs_to) ? $this->belongs_to[$key] : null; 
    510511                    $this->$key = $this->find_one_belongs_to($key, $parameters); 
     512                    if(is_null($this->$key)) unset($this->$key);                     
    511513                    break; 
    512514                case "has_and_belongs_to_many":