Changeset 3125
- Timestamp:
- 08/16/08 00:35:06 (3 months ago)
- Files:
-
- trunk/utils/copix/dao/CopixDAOGenerator.class.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/utils/copix/dao/CopixDAOGenerator.class.php
r3123 r3125 775 775 $result .= $php->getLine ('if (($pObject->' . $pkai->name .' !== null) && $pUseId) {', 2); 776 776 $line = '$query = \'INSERT INTO ' . $this->_definition->getPrimaryTableRealName () . ' ('; 777 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDB ($fields, ' object->');777 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDB ($fields, 'pObject->'); 778 778 $line .= implode (',', $fields); 779 779 $line .= ') VALUES ('; … … 784 784 $result .= $php->getLine ('} else {', 2); 785 785 $line = '$query = \'INSERT INTO ' . $this->_definition->getPrimaryTableRealName () . ' ('; 786 list ($fieldsNoAuto, $values, $formatted) = $this->_prepareValuesForNewDB ($fieldsNoAuto, ' object->');786 list ($fieldsNoAuto, $values, $formatted) = $this->_prepareValuesForNewDB ($fieldsNoAuto, 'pObject->'); 787 787 $line .= implode (',', $fieldsNoAuto); 788 788 $line .= ') VALUES ('; … … 794 794 } else { 795 795 $line = '$query = \'INSERT INTO ' . $this->_definition->getPrimaryTableRealName () . ' ('; 796 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDB ($fields, ' object->');796 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDB ($fields, 'pObject->'); 797 797 $line .= implode (',', $fields); 798 798 $line .= ') VALUES ('; … … 860 860 $result .= $php->getLine ('$ct = CopixDB::getConnection ($this->_connectionName);', 2); 861 861 $line = '$query = \'UPDATE ' . $this->_definition->getPrimaryTableRealName () . ' SET '; 862 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDb ($this->_definition->getPropertiesBy ('PrimaryFieldsExcludePk'), ' object->');862 list ($fields, $values, $formatted) = $this->_prepareValuesForNewDb ($this->_definition->getPropertiesBy ('PrimaryFieldsExcludePk'), 'pObject->'); 863 863 $sqlSet = ''; 864 864 … … 870 870 871 871 //condition on the PK 872 list ($arSqlCondition, $sqlCondition) = $this->_buildConditionsForNewDB ($pkFields, ' object->');872 list ($arSqlCondition, $sqlCondition) = $this->_buildConditionsForNewDB ($pkFields, 'pObject->'); 873 873 if ($sqlCondition != '') { 874 874 $line .= ' WHERE ' . $sqlCondition;
