new faker entries

new category view
This commit is contained in:
Etienne Roudeix
2013-08-13 11:40:24 +02:00
parent b9bc56a748
commit c9485075d4
7 changed files with 256 additions and 199 deletions

View File

@@ -891,6 +891,10 @@ abstract class Accessory implements ActiveRecordInterface
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = AccessoryTableMap::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . AccessoryTableMap::ID . ')');
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(AccessoryTableMap::ID)) {
@@ -948,6 +952,13 @@ abstract class Accessory implements ActiveRecordInterface
throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
}
try {
$pk = $con->lastInsertId();
} catch (Exception $e) {
throw new PropelException('Unable to get autoincrement id.', 0, $e);
}
$this->setId($pk);
$this->setNew(false);
}
@@ -1224,7 +1235,6 @@ abstract class Accessory implements ActiveRecordInterface
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setId($this->getId());
$copyObj->setProductId($this->getProductId());
$copyObj->setAccessory($this->getAccessory());
$copyObj->setPosition($this->getPosition());
@@ -1232,6 +1242,7 @@ abstract class Accessory implements ActiveRecordInterface
$copyObj->setUpdatedAt($this->getUpdatedAt());
if ($makeNew) {
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
}
}