start to create config process for Thelia
This commit is contained in:
@@ -735,6 +735,10 @@ abstract class BaseModule extends BaseObject implements Persistent
|
||||
$modifiedColumns = array();
|
||||
$index = 0;
|
||||
|
||||
$this->modifiedColumns[] = ModulePeer::ID;
|
||||
if (null !== $this->id) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key (' . ModulePeer::ID . ')');
|
||||
}
|
||||
|
||||
// check the columns in natural order for more readable SQL queries
|
||||
if ($this->isColumnModified(ModulePeer::ID)) {
|
||||
@@ -798,6 +802,13 @@ abstract class BaseModule extends BaseObject implements Persistent
|
||||
throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
|
||||
}
|
||||
|
||||
try {
|
||||
$pk = $con->lastInsertId();
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException('Unable to get autoincrement id.', $e);
|
||||
}
|
||||
$this->setId($pk);
|
||||
|
||||
$this->setNew(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -565,6 +565,10 @@ abstract class BaseModulePeer
|
||||
$criteria = $values->buildCriteria(); // build Criteria from Module object
|
||||
}
|
||||
|
||||
if ($criteria->containsKey(ModulePeer::ID) && $criteria->keyContainsValue(ModulePeer::ID) ) {
|
||||
throw new PropelException('Cannot insert a value for auto-increment primary key ('.ModulePeer::ID.')');
|
||||
}
|
||||
|
||||
|
||||
// Set the correct dbName
|
||||
$criteria->setDbName(ModulePeer::DATABASE_NAME);
|
||||
|
||||
Reference in New Issue
Block a user