start to create config process for Thelia

This commit is contained in:
Manuel Raynaud
2013-03-28 16:43:01 +01:00
parent 2154bbc1ed
commit 879a2e09a8
8 changed files with 133 additions and 45 deletions

View File

@@ -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);
}

View File

@@ -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);