Insert the row in the database.

@param PropelPDO $con

@throws PropelException
@see        doSave()
345300
protected function doInsert(PropelPDO $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[] = RemoteHistoryContaoPeer::ID;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . RemoteHistoryContaoPeer::ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(RemoteHistoryContaoPeer::ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::REMOTE_APP_ID)) {
            $modifiedColumns[':p' . $index++]  = '`remote_app_id`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::APIVERSION)) {
            $modifiedColumns[':p' . $index++]  = '`apiVersion`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::NAME)) {
            $modifiedColumns[':p' . $index++]  = '`name`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::VERSION)) {
            $modifiedColumns[':p' . $index++]  = '`version`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_DISPLAYERRORS)) {
            $modifiedColumns[':p' . $index++]  = '`config_displayErrors`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_BYPASSCACHE)) {
            $modifiedColumns[':p' . $index++]  = '`config_bypassCache`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_MINIFYMARKUP)) {
            $modifiedColumns[':p' . $index++]  = '`config_minifyMarkup`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_DEBUGMODE)) {
            $modifiedColumns[':p' . $index++]  = '`config_debugMode`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_MAINTENANCEMODE)) {
            $modifiedColumns[':p' . $index++]  = '`config_maintenanceMode`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_GZIPSCRIPTS)) {
            $modifiedColumns[':p' . $index++]  = '`config_gzipScripts`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_REWRITEURL)) {
            $modifiedColumns[':p' . $index++]  = '`config_rewriteURL`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_ADMINEMAIL)) {
            $modifiedColumns[':p' . $index++]  = '`config_adminEmail`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::CONFIG_CACHEMODE)) {
            $modifiedColumns[':p' . $index++]  = '`config_cacheMode`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::STATUSCODE)) {
            $modifiedColumns[':p' . $index++]  = '`statuscode`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::EXTENSIONS)) {
            $modifiedColumns[':p' . $index++]  = '`extensions`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::LOG)) {
            $modifiedColumns[':p' . $index++]  = '`log`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::PHP)) {
            $modifiedColumns[':p' . $index++]  = '`php`';
        }
        if ($this->isColumnModified(RemoteHistoryContaoPeer::MYSQL)) {
            $modifiedColumns[':p' . $index++]  = '`mysql`';
        }

        $sql = sprintf(
            'INSERT INTO `remote_history_contao` (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case '`id`':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case '`remote_app_id`':
                        $stmt->bindValue($identifier, $this->remote_app_id, PDO::PARAM_INT);
                        break;
                    case '`apiVersion`':
                        $stmt->bindValue($identifier, $this->apiversion, PDO::PARAM_STR);
                        break;
                    case '`name`':
                        $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                        break;
                    case '`version`':
                        $stmt->bindValue($identifier, $this->version, PDO::PARAM_STR);
                        break;
                    case '`config_displayErrors`':
                        $stmt->bindValue($identifier, $this->config_displayerrors, PDO::PARAM_STR);
                        break;
                    case '`config_bypassCache`':
                        $stmt->bindValue($identifier, $this->config_bypasscache, PDO::PARAM_STR);
                        break;
                    case '`config_minifyMarkup`':
                        $stmt->bindValue($identifier, $this->config_minifymarkup, PDO::PARAM_STR);
                        break;
                    case '`config_debugMode`':
                        $stmt->bindValue($identifier, $this->config_debugmode, PDO::PARAM_STR);
                        break;
                    case '`config_maintenanceMode`':
                        $stmt->bindValue($identifier, $this->config_maintenancemode, PDO::PARAM_STR);
                        break;
                    case '`config_gzipScripts`':
                        $stmt->bindValue($identifier, $this->config_gzipscripts, PDO::PARAM_STR);
                        break;
                    case '`config_rewriteURL`':
                        $stmt->bindValue($identifier, $this->config_rewriteurl, PDO::PARAM_STR);
                        break;
                    case '`config_adminEmail`':
                        $stmt->bindValue($identifier, $this->config_adminemail, PDO::PARAM_STR);
                        break;
                    case '`config_cacheMode`':
                        $stmt->bindValue($identifier, $this->config_cachemode, PDO::PARAM_STR);
                        break;
                    case '`statuscode`':
                        $stmt->bindValue($identifier, $this->statuscode, PDO::PARAM_INT);
                        break;
                    case '`extensions`':
                        $stmt->bindValue($identifier, $this->extensions, PDO::PARAM_STR);
                        break;
                    case '`log`':
                        $stmt->bindValue($identifier, $this->log, PDO::PARAM_STR);
                        break;
                    case '`php`':
                        $stmt->bindValue($identifier, $this->php, PDO::PARAM_STR);
                        break;
                    case '`mysql`':
                        $stmt->bindValue($identifier, $this->mysql, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
762093
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(RolePermissionTableMap::COL_ROLE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ROLE_ID';
        }
        if ($this->isColumnModified(RolePermissionTableMap::COL_PERMISSION_ID)) {
            $modifiedColumns[':p' . $index++]  = 'PERMISSION_ID';
        }

        $sql = sprintf(
            'INSERT INTO role_permission (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ROLE_ID':
                        $stmt->bindValue($identifier, $this->role_id, PDO::PARAM_INT);
                        break;
                    case 'PERMISSION_ID':
                        $stmt->bindValue($identifier, $this->permission_id, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        $this->setNew(false);
    }
1342678
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(M2PTableMap::COL_MEDIA_ID)) {
            $modifiedColumns[':p' . $index++]  = 'media_id';
        }
        if ($this->isColumnModified(M2PTableMap::COL_PAGE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'page_id';
        }

        $sql = sprintf(
            'INSERT INTO m2p (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'media_id':
                        $stmt->bindValue($identifier, $this->media_id, PDO::PARAM_INT);
                        break;
                    case 'page_id':
                        $stmt->bindValue($identifier, $this->page_id, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        $this->setNew(false);
    }
1306955
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[AttributeAttributeTypeTableMap::ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . AttributeAttributeTypeTableMap::ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(AttributeAttributeTypeTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(AttributeAttributeTypeTableMap::ATTRIBUTE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ATTRIBUTE_ID';
        }
        if ($this->isColumnModified(AttributeAttributeTypeTableMap::ATTRIBUTE_TYPE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ATTRIBUTE_TYPE_ID';
        }

        $sql = sprintf(
            'INSERT INTO attribute_attribute_type (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'ATTRIBUTE_ID':
                        $stmt->bindValue($identifier, $this->attribute_id, PDO::PARAM_INT);
                        break;
                    case 'ATTRIBUTE_TYPE_ID':
                        $stmt->bindValue($identifier, $this->attribute_type_id, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
264402
protected function doInsert(PropelPDO $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[] = UserPeer::ID;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserPeer::ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(UserPeer::ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(UserPeer::USERNAME)) {
            $modifiedColumns[':p' . $index++]  = '`username`';
        }
        if ($this->isColumnModified(UserPeer::PASSWORD)) {
            $modifiedColumns[':p' . $index++]  = '`password`';
        }
        if ($this->isColumnModified(UserPeer::SALT)) {
            $modifiedColumns[':p' . $index++]  = '`salt`';
        }
        if ($this->isColumnModified(UserPeer::FIRSTNAME)) {
            $modifiedColumns[':p' . $index++]  = '`firstname`';
        }
        if ($this->isColumnModified(UserPeer::LASTNAME)) {
            $modifiedColumns[':p' . $index++]  = '`lastname`';
        }
        if ($this->isColumnModified(UserPeer::EMAIL)) {
            $modifiedColumns[':p' . $index++]  = '`email`';
        }
        if ($this->isColumnModified(UserPeer::PHONE)) {
            $modifiedColumns[':p' . $index++]  = '`phone`';
        }
        if ($this->isColumnModified(UserPeer::MEMO)) {
            $modifiedColumns[':p' . $index++]  = '`memo`';
        }
        if ($this->isColumnModified(UserPeer::ACTIVATED)) {
            $modifiedColumns[':p' . $index++]  = '`activated`';
        }
        if ($this->isColumnModified(UserPeer::LAST_LOGIN)) {
            $modifiedColumns[':p' . $index++]  = '`last_login`';
        }
        if ($this->isColumnModified(UserPeer::NOTIFICATION_CHANGE)) {
            $modifiedColumns[':p' . $index++]  = '`notification_change`';
        }
        if ($this->isColumnModified(UserPeer::NOTIFICATION_ERROR)) {
            $modifiedColumns[':p' . $index++]  = '`notification_error`';
        }

        $sql = sprintf(
            'INSERT INTO `user` (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case '`id`':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case '`username`':
                        $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                        break;
                    case '`password`':
                        $stmt->bindValue($identifier, $this->password, PDO::PARAM_STR);
                        break;
                    case '`salt`':
                        $stmt->bindValue($identifier, $this->salt, PDO::PARAM_STR);
                        break;
                    case '`firstname`':
                        $stmt->bindValue($identifier, $this->firstname, PDO::PARAM_STR);
                        break;
                    case '`lastname`':
                        $stmt->bindValue($identifier, $this->lastname, PDO::PARAM_STR);
                        break;
                    case '`email`':
                        $stmt->bindValue($identifier, $this->email, PDO::PARAM_STR);
                        break;
                    case '`phone`':
                        $stmt->bindValue($identifier, $this->phone, PDO::PARAM_STR);
                        break;
                    case '`memo`':
                        $stmt->bindValue($identifier, $this->memo, PDO::PARAM_STR);
                        break;
                    case '`activated`':
                        $stmt->bindValue($identifier, (int) $this->activated, PDO::PARAM_INT);
                        break;
                    case '`last_login`':
                        $stmt->bindValue($identifier, $this->last_login, PDO::PARAM_STR);
                        break;
                    case '`notification_change`':
                        $stmt->bindValue($identifier, (int) $this->notification_change, PDO::PARAM_INT);
                        break;
                    case '`notification_error`':
                        $stmt->bindValue($identifier, (int) $this->notification_error, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
876034
public function doDelete(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection($this->getDbName());
        }

        $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName());
        $dbMap = Propel::getServiceContainer()->getDatabaseMap($this->getDbName());

        // join are not supported with DELETE statement
        if (count($this->getJoins())) {
            throw new PropelException('Delete does not support join');
        }

        // Set up a list of required tables (one DELETE statement will
        // be executed per table)
        $tables = $this->getTablesColumns();
        if (empty($tables)) {
            throw new PropelException("Cannot delete from an empty Criteria");
        }

        $affectedRows = 0; // initialize this in case the next loop has no iterations.

        foreach ($tables as $tableName => $columns) {

            $whereClause = [];
            $params = [];
            $stmt = null;
            try {
                $sql = $adapter->getDeleteFromClause($this, $tableName);

                foreach ($columns as $colName) {
                    $sb = '';
                    $this->getCriterion($colName)->appendPsTo($sb, $params);
                    $this->replaceNames($sb);
                    $whereClause[] = $sb;
                }
                $sql .= ' WHERE ' .  implode(' AND ', $whereClause);

                $stmt = $con->prepare($sql);

                $adapter->bindValues($stmt, $params, $dbMap);
                $stmt->execute();
                $affectedRows = $stmt->rowCount();
            } catch (\Exception $e) {
                Propel::log($e->getMessage(), Propel::LOG_ERR);
                throw new PropelException(sprintf('Unable to execute DELETE statement [%s]', $sql), 0, $e);
            }

        } // for each table

        return $affectedRows;
    }
546037
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[LineageTableMap::COL_ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . LineageTableMap::COL_ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(LineageTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(LineageTableMap::COL_SKILL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`skill_id`';
        }
        if ($this->isColumnModified(LineageTableMap::COL_ANCESTOR_ID)) {
            $modifiedColumns[':p' . $index++]  = '`ancestor_id`';
        }
        if ($this->isColumnModified(LineageTableMap::COL_POSITION)) {
            $modifiedColumns[':p' . $index++]  = '`position`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_lineage` (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case '`id`':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case '`skill_id`':
                        $stmt->bindValue($identifier, $this->skill_id, PDO::PARAM_INT);
                        break;
                    case '`ancestor_id`':
                        $stmt->bindValue($identifier, $this->ancestor_id, PDO::PARAM_INT);
                        break;
                    case '`position`':
                        $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
849413
public function insert()
    {
        if ($this->stored) {
            throw new \LogicException("You may not insert an already stored entity");
        }

        $this->callEvent('insert');

        if (empty($this->modified)) {
            return;
        }

        $values = array_intersect_key($this->values, $this->modified);
        $this->connection->insert(static::$table, $values, static::$types);
        //this will only work with some database vendors for now.
        $this->values[static::$primary_key] = $this->connection->lastInsertId();
        $this->setStored();
    }
981772
public function getId(PDO $con, $name = null)
    {
        if ($name === null) {
            throw new PropelException("Unable to fetch next sequence ID without sequence name.");
        }

        $stmt = $con->query("SELECT " . $name . ".nextval FROM dual");
        $row = $stmt->fetch(PDO::FETCH_NUM);

        return $row[0];
    }
15572
public function delete($con = null)
    {
        if (count($this->getMap()) == 0) {
            throw new PropelException('delete() expects a Criteria with at least one condition. Use deleteAll() to delete all the rows of a table');
        }

        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_WRITE);
        }

        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $criteria->setDbName($this->getDbName());

        $con->beginTransaction();
        try {
            if (!$affectedRows = $criteria->basePreDelete($con)) {
                $affectedRows = $criteria->doDelete($con);
            }
            $criteria->basePostDelete($affectedRows, $con);
            $con->commit();
        } catch (Exception $e) {
            $con->rollback();
            throw $e;
        }

        return $affectedRows;
    }
918293
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::PERSON_ID)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_ID';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::TEAM_ID)) {
            $modifiedColumns[':p' . $index++]  = 'TEAM_ID';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::VERSION_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_AT';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::VERSION_CREATED_BY)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_BY';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::PERSON_ID_VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_ID_VERSION';
        }
        if ($this->isColumnModified(PersonTeamLinkVersionTableMap::TEAM_ID_VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'TEAM_ID_VERSION';
        }

        $sql = sprintf(
            'INSERT INTO person_team_link_version (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'PERSON_ID':
                        $stmt->bindValue($identifier, $this->person_id, PDO::PARAM_INT);
                        break;
                    case 'TEAM_ID':
                        $stmt->bindValue($identifier, $this->team_id, PDO::PARAM_INT);
                        break;
                    case 'CREATED_AT':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'UPDATED_AT':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION':
                        $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
                        break;
                    case 'VERSION_CREATED_AT':
                        $stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION_CREATED_BY':
                        $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
                        break;
                    case 'PERSON_ID_VERSION':
                        $stmt->bindValue($identifier, $this->person_id_version, PDO::PARAM_INT);
                        break;
                    case 'TEAM_ID_VERSION':
                        $stmt->bindValue($identifier, $this->team_id_version, PDO::PARAM_INT);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        $this->setNew(false);
    }
803850
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[LoginLogTableMap::COL_ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . LoginLogTableMap::COL_ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(LoginLogTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_TYPE)) {
            $modifiedColumns[':p' . $index++]  = 'TYPE';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_DATE_TIME)) {
            $modifiedColumns[':p' . $index++]  = 'DATE_TIME';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_USER_ID)) {
            $modifiedColumns[':p' . $index++]  = 'USER_ID';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_USERNAME)) {
            $modifiedColumns[':p' . $index++]  = 'USERNAME';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_SESSION_ID)) {
            $modifiedColumns[':p' . $index++]  = 'SESSION_ID';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_CLIENT_ADDRESS)) {
            $modifiedColumns[':p' . $index++]  = 'CLIENT_ADDRESS';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_CLIENT_IP)) {
            $modifiedColumns[':p' . $index++]  = 'CLIENT_IP';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_CLIENT_AGENT)) {
            $modifiedColumns[':p' . $index++]  = 'CLIENT_AGENT';
        }
        if ($this->isColumnModified(LoginLogTableMap::COL_CLIENT_PLATFORM)) {
            $modifiedColumns[':p' . $index++]  = 'CLIENT_PLATFORM';
        }

        $sql = sprintf(
            'INSERT INTO login_log (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'TYPE':
                        $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
                        break;
                    case 'DATE_TIME':
                        $stmt->bindValue($identifier, $this->date_time ? $this->date_time->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'USER_ID':
                        $stmt->bindValue($identifier, $this->user_id, PDO::PARAM_STR);
                        break;
                    case 'USERNAME':
                        $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                        break;
                    case 'SESSION_ID':
                        $stmt->bindValue($identifier, $this->session_id, PDO::PARAM_STR);
                        break;
                    case 'CLIENT_ADDRESS':
                        $stmt->bindValue($identifier, $this->client_address, PDO::PARAM_STR);
                        break;
                    case 'CLIENT_IP':
                        $stmt->bindValue($identifier, $this->client_ip, PDO::PARAM_STR);
                        break;
                    case 'CLIENT_AGENT':
                        $stmt->bindValue($identifier, $this->client_agent, PDO::PARAM_STR);
                        break;
                    case 'CLIENT_PLATFORM':
                        $stmt->bindValue($identifier, $this->client_platform, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
213377
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

        $this->modifiedColumns[FeatureTypeTableMap::ID] = true;
        if (null !== $this->id) {
            throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureTypeTableMap::ID . ')');
        }

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(FeatureTypeTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::SLUG)) {
            $modifiedColumns[':p' . $index++]  = 'SLUG';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::HAS_FEATURE_AV_VALUE)) {
            $modifiedColumns[':p' . $index++]  = 'HAS_FEATURE_AV_VALUE';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::IS_MULTILINGUAL_FEATURE_AV_VALUE)) {
            $modifiedColumns[':p' . $index++]  = 'IS_MULTILINGUAL_FEATURE_AV_VALUE';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::PATTERN)) {
            $modifiedColumns[':p' . $index++]  = 'PATTERN';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::CSS_CLASS)) {
            $modifiedColumns[':p' . $index++]  = 'CSS_CLASS';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::INPUT_TYPE)) {
            $modifiedColumns[':p' . $index++]  = 'INPUT_TYPE';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::MAX)) {
            $modifiedColumns[':p' . $index++]  = 'MAX';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::MIN)) {
            $modifiedColumns[':p' . $index++]  = 'MIN';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::STEP)) {
            $modifiedColumns[':p' . $index++]  = 'STEP';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::IMAGE_MAX_WIDTH)) {
            $modifiedColumns[':p' . $index++]  = 'IMAGE_MAX_WIDTH';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::IMAGE_MAX_HEIGHT)) {
            $modifiedColumns[':p' . $index++]  = 'IMAGE_MAX_HEIGHT';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::IMAGE_RATIO)) {
            $modifiedColumns[':p' . $index++]  = 'IMAGE_RATIO';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(FeatureTypeTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }

        $sql = sprintf(
            'INSERT INTO feature_type (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'SLUG':
                        $stmt->bindValue($identifier, $this->slug, PDO::PARAM_STR);
                        break;
                    case 'HAS_FEATURE_AV_VALUE':
                        $stmt->bindValue($identifier, $this->has_feature_av_value, PDO::PARAM_INT);
                        break;
                    case 'IS_MULTILINGUAL_FEATURE_AV_VALUE':
                        $stmt->bindValue($identifier, $this->is_multilingual_feature_av_value, PDO::PARAM_INT);
                        break;
                    case 'PATTERN':
                        $stmt->bindValue($identifier, $this->pattern, PDO::PARAM_STR);
                        break;
                    case 'CSS_CLASS':
                        $stmt->bindValue($identifier, $this->css_class, PDO::PARAM_STR);
                        break;
                    case 'INPUT_TYPE':
                        $stmt->bindValue($identifier, $this->input_type, PDO::PARAM_STR);
                        break;
                    case 'MAX':
                        $stmt->bindValue($identifier, $this->max, PDO::PARAM_STR);
                        break;
                    case 'MIN':
                        $stmt->bindValue($identifier, $this->min, PDO::PARAM_STR);
                        break;
                    case 'STEP':
                        $stmt->bindValue($identifier, $this->step, PDO::PARAM_STR);
                        break;
                    case 'IMAGE_MAX_WIDTH':
                        $stmt->bindValue($identifier, $this->image_max_width, PDO::PARAM_STR);
                        break;
                    case 'IMAGE_MAX_HEIGHT':
                        $stmt->bindValue($identifier, $this->image_max_height, PDO::PARAM_STR);
                        break;
                    case 'IMAGE_RATIO':
                        $stmt->bindValue($identifier, $this->image_ratio, PDO::PARAM_STR);
                        break;
                    case 'CREATED_AT':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'UPDATED_AT':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            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);
    }
1161621
public function getCustomer(PropelPDO $con = null, $doQuery = true)
    {
        if ($this->aCustomer === null && ($this->customer_id !== null) && $doQuery) {
            $this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aCustomer->addUserCustomerRelations($this);
             */
        }

        return $this->aCustomer;
    }
92431
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PersonFunctionVersionTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::CODE)) {
            $modifiedColumns[':p' . $index++]  = 'CODE';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_AT';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::VERSION_CREATED_BY)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_BY';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::PERSON_FUNCTION_LINK_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_FUNCTION_LINK_IDS';
        }
        if ($this->isColumnModified(PersonFunctionVersionTableMap::PERSON_FUNCTION_LINK_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_FUNCTION_LINK_VERSIONS';
        }

        $sql = sprintf(
            'INSERT INTO person_function_version (%s) VALUES (%s)',
            implode(', ', $modifiedColumns),
            implode(', ', array_keys($modifiedColumns))
        );

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'ID':
                        $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
                        break;
                    case 'CODE':
                        $stmt->bindValue($identifier, $this->code, PDO::PARAM_STR);
                        break;
                    case 'CREATED_AT':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'UPDATED_AT':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION':
                        $stmt->bindValue($identifier, $this->version, PDO::PARAM_INT);
                        break;
                    case 'VERSION_CREATED_AT':
                        $stmt->bindValue($identifier, $this->version_created_at ? $this->version_created_at->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'VERSION_CREATED_BY':
                        $stmt->bindValue($identifier, $this->version_created_by, PDO::PARAM_STR);
                        break;
                    case 'PERSON_FUNCTION_LINK_IDS':
                        $stmt->bindValue($identifier, $this->person_function_link_ids, PDO::PARAM_STR);
                        break;
                    case 'PERSON_FUNCTION_LINK_VERSIONS':
                        $stmt->bindValue($identifier, $this->person_function_link_versions, PDO::PARAM_STR);
                        break;
                }
            }
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), 0, $e);
        }

        $this->setNew(false);
    }
973657
public function save($con = null)
    {
        if (!method_exists($this->getModel(), 'save')) {
            throw new PropelException('Cannot save objects on a read-only model');
        }
        if (null === $con) {
            $con = $this->getConnection(Propel::CONNECTION_WRITE);
        }
        $con->beginTransaction();
        try {
            /** @var $element BaseObject */
            foreach ($this as $element) {
                $element->save($con);
            }
            $con->commit();
        } catch (Exception $e) {
            $con->rollback();
            throw $e;
        }
    }
159825
public function postInsert(ConnectionInterface $con = null)
    {
        parent::postInsert($con);

        $this->dispatchEvent(TheliaEvents::AFTER_CREATEADDRESS, new AddressEvent($this));
    }