Changeset 2924
- Timestamp:
- 07/23/08 10:26:17 (1 month ago)
- Files:
-
- trunk/utils/copix/dao/CopixDAOGenerator.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/utils/copix/dao/CopixDAOGenerator.class.php
r2870 r2924 165 165 166 166 //declaration of properties. 167 $result .= $this->_writeFieldsInfoWith ('name', ' var$', " = null;\n", '', $usingFields);167 $result .= $this->_writeFieldsInfoWith ('name', ' public $', " = null;\n", '', $usingFields); 168 168 169 169 //InitFromDBObject 170 170 $methodName = in_array ('initFromDBObject', $classMethods) ? '_compiled_initFromDBObject' : 'initFromDBObject'; 171 171 $result .= ' public function ' . $methodName . ' ($dbRecord) {' . "\n"; 172 $result .= ' $record = _ppo ($dbRecord);'."\n"; 172 173 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"; 178 175 } 179 176 $result .= ' return $this;';
