Changeset 5321

Show
Ignore:
Timestamp:
12/21/08 22:34:19 (7 months ago)
Author:
jwage
Message:

[1.0, 1.1] Fixing data fixtures so they work with setters on behaviors (closes #1680)

Location:
branches
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Data/Import.php

    r5320 r5321  
    220220                    $obj->set($key, $this->_getImportedObject($value, $obj, $key, $rowKey)); 
    221221                } 
     222            // used for Doctrine plugin methods (Doctrine_Template) 
     223            } else if (is_callable(array($obj, 'set' . Doctrine_Inflector::classify($key)))) { 
     224              $func = 'set' . Doctrine_Inflector::classify($key); 
     225              $obj->$func($value); 
    222226            } else { 
    223227                throw new Doctrine_Data_Exception('Invalid fixture element "'. $key . '" under "' . $rowKey . '"'); 
  • branches/1.1/lib/Doctrine/Data/Import.php

    r5320 r5321  
    220220                    $obj->set($key, $this->_getImportedObject($value, $obj, $key, $rowKey)); 
    221221                } 
     222            // used for Doctrine plugin methods (Doctrine_Template) 
     223            } else if (is_callable(array($obj, 'set' . Doctrine_Inflector::classify($key)))) { 
     224              $func = 'set' . Doctrine_Inflector::classify($key); 
     225              $obj->$func($value); 
    222226            } else { 
    223227                throw new Doctrine_Data_Exception('Invalid fixture element "'. $key . '" under "' . $rowKey . '"');