Changeset 2924

Show
Ignore:
Timestamp:
07/23/08 10:26:17 (1 month ago)
Author:
gcroes
Message:

on génère public et non plus var dans les propriétés des record.
initFromDbObject utilise maintenant un ppo plutot que de tester systématiquement is_array () sur l'élément passé en paramètre

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/utils/copix/dao/CopixDAOGenerator.class.php

    r2870 r2924  
    165165 
    166166        //declaration of properties. 
    167         $result .= $this->_writeFieldsInfoWith ('name', ' var $', " = null;\n", '', $usingFields); 
     167        $result .= $this->_writeFieldsInfoWith ('name', ' public $', " = null;\n", '', $usingFields); 
    168168 
    169169        //InitFromDBObject 
    170170        $methodName = in_array ('initFromDBObject', $classMethods) ? '_compiled_initFromDBObject' : 'initFromDBObject'; 
    171171        $result .= ' public function ' . $methodName . ' ($dbRecord) {' . "\n"; 
     172        $result .= '  $record = _ppo ($dbRecord);'."\n"; 
    172173        foreach ($this->_definition->getProperties () as $field) { 
    173             $result .= ' if (is_array ($dbRecord)) {' . "\n"; 
    174             $result .= ' $this->' . $field->name . '= $dbRecord[\'' . $field->name . "'];\n"; 
    175             $result .= '} else {' . "\n"; 
    176             $result .= ' $this->' . $field->name . '= $dbRecord->' . $field->name . ";\n"; 
    177             $result .= '}'; 
     174            $result .= ' $this->' . $field->name . '= $record->' . $field->name . ";\n"; 
    178175        } 
    179176        $result .= ' return $this;';