Issue a DELETE query based on the current ModelCriteria
An optional hook on basePreDelete() can prevent the actual deletion

@param PropelPDO $con an optional connection object

@return integer the number of deleted rows

@throws PropelException
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;
    }
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);
    }
447032
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PersonImageTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(PersonImageTableMap::FILE)) {
            $modifiedColumns[':p' . $index++]  = 'FILE';
        }
        if ($this->isColumnModified(PersonImageTableMap::PERSON_ID)) {
            $modifiedColumns[':p' . $index++]  = 'PERSON_ID';
        }
        if ($this->isColumnModified(PersonImageTableMap::VISIBLE)) {
            $modifiedColumns[':p' . $index++]  = 'VISIBLE';
        }
        if ($this->isColumnModified(PersonImageTableMap::POSITION)) {
            $modifiedColumns[':p' . $index++]  = 'POSITION';
        }
        if ($this->isColumnModified(PersonImageTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(PersonImageTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }

        $sql = sprintf(
            'INSERT INTO person_image (%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 'FILE':
                        $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR);
                        break;
                    case 'PERSON_ID':
                        $stmt->bindValue($identifier, $this->person_id, PDO::PARAM_INT);
                        break;
                    case 'VISIBLE':
                        $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
                        break;
                    case 'POSITION':
                        $stmt->bindValue($identifier, $this->position, 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;
                }
            }
            $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);
    }
1126622
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(SkillTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_SPORT_ID)) {
            $modifiedColumns[':p' . $index++]  = '`sport_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_NAME)) {
            $modifiedColumns[':p' . $index++]  = '`name`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_ALTERNATIVE_NAME)) {
            $modifiedColumns[':p' . $index++]  = '`alternative_name`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_SLUG)) {
            $modifiedColumns[':p' . $index++]  = '`slug`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_DESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = '`description`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_HISTORY)) {
            $modifiedColumns[':p' . $index++]  = '`history`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_TRANSLATION)) {
            $modifiedColumns[':p' . $index++]  = '`is_translation`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_ROTATION)) {
            $modifiedColumns[':p' . $index++]  = '`is_rotation`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_ACYCLIC)) {
            $modifiedColumns[':p' . $index++]  = '`is_acyclic`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_CYCLIC)) {
            $modifiedColumns[':p' . $index++]  = '`is_cyclic`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_LONGITUDINAL_FLAGS)) {
            $modifiedColumns[':p' . $index++]  = '`longitudinal_flags`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_LATITUDINAL_FLAGS)) {
            $modifiedColumns[':p' . $index++]  = '`latitudinal_flags`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_TRANSVERSAL_FLAGS)) {
            $modifiedColumns[':p' . $index++]  = '`transversal_flags`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_MOVEMENT_DESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = '`movement_description`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_SEQUENCE_PICTURE_URL)) {
            $modifiedColumns[':p' . $index++]  = '`sequence_picture_url`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_VARIATION_OF_ID)) {
            $modifiedColumns[':p' . $index++]  = '`variation_of_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_START_POSITION_ID)) {
            $modifiedColumns[':p' . $index++]  = '`start_position_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_END_POSITION_ID)) {
            $modifiedColumns[':p' . $index++]  = '`end_position_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_COMPOSITE)) {
            $modifiedColumns[':p' . $index++]  = '`is_composite`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IS_MULTIPLE)) {
            $modifiedColumns[':p' . $index++]  = '`is_multiple`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_MULTIPLE_OF_ID)) {
            $modifiedColumns[':p' . $index++]  = '`multiple_of_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_MULTIPLIER)) {
            $modifiedColumns[':p' . $index++]  = '`multiplier`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_GENERATION)) {
            $modifiedColumns[':p' . $index++]  = '`generation`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_IMPORTANCE)) {
            $modifiedColumns[':p' . $index++]  = '`importance`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_PICTURE_ID)) {
            $modifiedColumns[':p' . $index++]  = '`picture_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_VIDEO_ID)) {
            $modifiedColumns[':p' . $index++]  = '`video_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_TUTORIAL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`tutorial_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_KSTRUKTUR_ID)) {
            $modifiedColumns[':p' . $index++]  = '`kstruktur_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_FUNCTION_PHASE_ID)) {
            $modifiedColumns[':p' . $index++]  = '`function_phase_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_OBJECT_ID)) {
            $modifiedColumns[':p' . $index++]  = '`object_id`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_VERSION)) {
            $modifiedColumns[':p' . $index++]  = '`version`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_VERSION_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = '`version_created_at`';
        }
        if ($this->isColumnModified(SkillTableMap::COL_VERSION_COMMENT)) {
            $modifiedColumns[':p' . $index++]  = '`version_comment`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_skill` (%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 '`sport_id`':
                        $stmt->bindValue($identifier, $this->sport_id, PDO::PARAM_INT);
                        break;
                    case '`name`':
                        $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                        break;
                    case '`alternative_name`':
                        $stmt->bindValue($identifier, $this->alternative_name, PDO::PARAM_STR);
                        break;
                    case '`slug`':
                        $stmt->bindValue($identifier, $this->slug, PDO::PARAM_STR);
                        break;
                    case '`description`':
                        $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                        break;
                    case '`history`':
                        $stmt->bindValue($identifier, $this->history, PDO::PARAM_STR);
                        break;
                    case '`is_translation`':
                        $stmt->bindValue($identifier, (int) $this->is_translation, PDO::PARAM_INT);
                        break;
                    case '`is_rotation`':
                        $stmt->bindValue($identifier, (int) $this->is_rotation, PDO::PARAM_INT);
                        break;
                    case '`is_acyclic`':
                        $stmt->bindValue($identifier, (int) $this->is_acyclic, PDO::PARAM_INT);
                        break;
                    case '`is_cyclic`':
                        $stmt->bindValue($identifier, (int) $this->is_cyclic, PDO::PARAM_INT);
                        break;
                    case '`longitudinal_flags`':
                        $stmt->bindValue($identifier, $this->longitudinal_flags, PDO::PARAM_INT);
                        break;
                    case '`latitudinal_flags`':
                        $stmt->bindValue($identifier, $this->latitudinal_flags, PDO::PARAM_INT);
                        break;
                    case '`transversal_flags`':
                        $stmt->bindValue($identifier, $this->transversal_flags, PDO::PARAM_INT);
                        break;
                    case '`movement_description`':
                        $stmt->bindValue($identifier, $this->movement_description, PDO::PARAM_STR);
                        break;
                    case '`sequence_picture_url`':
                        $stmt->bindValue($identifier, $this->sequence_picture_url, PDO::PARAM_STR);
                        break;
                    case '`variation_of_id`':
                        $stmt->bindValue($identifier, $this->variation_of_id, PDO::PARAM_INT);
                        break;
                    case '`start_position_id`':
                        $stmt->bindValue($identifier, $this->start_position_id, PDO::PARAM_INT);
                        break;
                    case '`end_position_id`':
                        $stmt->bindValue($identifier, $this->end_position_id, PDO::PARAM_INT);
                        break;
                    case '`is_composite`':
                        $stmt->bindValue($identifier, (int) $this->is_composite, PDO::PARAM_INT);
                        break;
                    case '`is_multiple`':
                        $stmt->bindValue($identifier, (int) $this->is_multiple, PDO::PARAM_INT);
                        break;
                    case '`multiple_of_id`':
                        $stmt->bindValue($identifier, $this->multiple_of_id, PDO::PARAM_INT);
                        break;
                    case '`multiplier`':
                        $stmt->bindValue($identifier, $this->multiplier, PDO::PARAM_INT);
                        break;
                    case '`generation`':
                        $stmt->bindValue($identifier, $this->generation, PDO::PARAM_INT);
                        break;
                    case '`importance`':
                        $stmt->bindValue($identifier, $this->importance, PDO::PARAM_INT);
                        break;
                    case '`picture_id`':
                        $stmt->bindValue($identifier, $this->picture_id, PDO::PARAM_INT);
                        break;
                    case '`video_id`':
                        $stmt->bindValue($identifier, $this->video_id, PDO::PARAM_INT);
                        break;
                    case '`tutorial_id`':
                        $stmt->bindValue($identifier, $this->tutorial_id, PDO::PARAM_INT);
                        break;
                    case '`kstruktur_id`':
                        $stmt->bindValue($identifier, $this->kstruktur_id, PDO::PARAM_INT);
                        break;
                    case '`function_phase_id`':
                        $stmt->bindValue($identifier, $this->function_phase_id, PDO::PARAM_INT);
                        break;
                    case '`object_id`':
                        $stmt->bindValue($identifier, $this->object_id, PDO::PARAM_INT);
                        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_comment`':
                        $stmt->bindValue($identifier, $this->version_comment, 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);
    }
466094
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(SourceTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(SourceTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = 'title';
        }
        if ($this->isColumnModified(SourceTableMap::COL_HOST)) {
            $modifiedColumns[':p' . $index++]  = 'host';
        }
        if ($this->isColumnModified(SourceTableMap::COL_ENDPOINT)) {
            $modifiedColumns[':p' . $index++]  = 'endpoint';
        }
        if ($this->isColumnModified(SourceTableMap::COL_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'created_at';
        }
        if ($this->isColumnModified(SourceTableMap::COL_UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'updated_at';
        }

        $sql = sprintf(
            'INSERT INTO source (%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 'title':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case 'host':
                        $stmt->bindValue($identifier, $this->host, PDO::PARAM_STR);
                        break;
                    case 'endpoint':
                        $stmt->bindValue($identifier, $this->endpoint, PDO::PARAM_STR);
                        break;
                    case 'created_at':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'updated_at':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s.u") : 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);
    }
167774
public function queriedDelete(Query $query)
    {
        if ($query->getLimit()
            || $query->getSort()
            || ($query instanceof RqlQuery && $query->getGroupBy())
            || $query->getSelect()) {
            throw new InvalidArgumentException('Only where clause allowed for delete');
        }

        $conditionBuilder = new SqlConditionBuilder(
            $this->getDbTable()->getAdapter(),
            $this->getDbTable()->getTable()
        );

        $sql = new Sql($this->getDbTable()->getAdapter());
        $delete = $sql->delete($this->getDbTable()->getTable());
        $delete->where($conditionBuilder->__invoke($query->getQuery()));
        $sqlString = $sql->buildSqlString($delete);

        $adapter = $this->dbTable->getAdapter();
        $shouldDeletedIds = array_map(function ($item) {
            return $item[$this->getIdentifier()];
        }, $this->query($query));

        try {
            $statement = $adapter->getDriver()->createStatement($sqlString);
            $result = $statement->execute();
        } catch (\Throwable $e) {
            throw new DataStoreException("Can't delete records using query", 0, $e);
        }

        if (count($shouldDeletedIds) === $result->getAffectedRows()) {
            return $shouldDeletedIds;
        } else {
            $result = $this->query($query);

            foreach ($result as $record) {
                if (in_array($record[$this->getIdentifier()], $shouldDeletedIds)) {
                    unset($shouldDeletedIds[$record[$this->getIdentifier()]]);
                }
            }
        }

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

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(StructureNodeTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_TYPE)) {
            $modifiedColumns[':p' . $index++]  = '`type`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_SKILL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`skill_id`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = '`title`';
        }
        if ($this->isColumnModified(StructureNodeTableMap::COL_DESCENDANT_CLASS)) {
            $modifiedColumns[':p' . $index++]  = '`descendant_class`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_structure_node` (%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 '`skill_id`':
                        $stmt->bindValue($identifier, $this->skill_id, PDO::PARAM_INT);
                        break;
                    case '`title`':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case '`descendant_class`':
                        $stmt->bindValue($identifier, $this->descendant_class, 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);
    }
392729
public function delete(ConnectionInterface $con = null)
    {
        if ($this->isDeleted()) {
            throw new PropelException("This object has already been deleted.");
        }

        if ($con === null) {
            $con = Propel::getServiceContainer()->getWriteConnection(CategoryTableMap::DATABASE_NAME);
        }

        $con->transaction(function () use ($con) {
            $deleteQuery = ChildCategoryQuery::create()
                ->filterByPrimaryKey($this->getPrimaryKey());
            $ret = $this->preDelete($con);
            // nested_set behavior
            if ($this->isRoot()) {
                throw new PropelException('Deletion of a root node is disabled for nested sets. Use ChildCategoryQuery::deleteTree() instead to delete an entire tree');
            }

            if ($this->isInTree()) {
                $this->deleteDescendants($con);
            }

            if ($ret) {
                $deleteQuery->delete($con);
                $this->postDelete($con);
                // nested_set behavior
                if ($this->isInTree()) {
                    // fill up the room that was used by the node
                    ChildCategoryQuery::shiftRLValues(-2, $this->getRightValue() + 1, null, $con);
                }

                $this->setDeleted(true);
            }
        });
    }
590441
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PictureTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = '`title`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_DESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = '`description`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_URL)) {
            $modifiedColumns[':p' . $index++]  = '`url`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_THUMB_URL)) {
            $modifiedColumns[':p' . $index++]  = '`thumb_url`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_SKILL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`skill_id`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_PHOTOGRAPHER)) {
            $modifiedColumns[':p' . $index++]  = '`photographer`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_PHOTOGRAPHER_ID)) {
            $modifiedColumns[':p' . $index++]  = '`photographer_id`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_ATHLETE)) {
            $modifiedColumns[':p' . $index++]  = '`athlete`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_ATHLETE_ID)) {
            $modifiedColumns[':p' . $index++]  = '`athlete_id`';
        }
        if ($this->isColumnModified(PictureTableMap::COL_UPLOADER_ID)) {
            $modifiedColumns[':p' . $index++]  = '`uploader_id`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_picture` (%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 '`title`':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case '`description`':
                        $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                        break;
                    case '`url`':
                        $stmt->bindValue($identifier, $this->url, PDO::PARAM_STR);
                        break;
                    case '`thumb_url`':
                        $stmt->bindValue($identifier, $this->thumb_url, PDO::PARAM_STR);
                        break;
                    case '`skill_id`':
                        $stmt->bindValue($identifier, $this->skill_id, PDO::PARAM_INT);
                        break;
                    case '`photographer`':
                        $stmt->bindValue($identifier, $this->photographer, PDO::PARAM_STR);
                        break;
                    case '`photographer_id`':
                        $stmt->bindValue($identifier, $this->photographer_id, PDO::PARAM_INT);
                        break;
                    case '`athlete`':
                        $stmt->bindValue($identifier, $this->athlete, PDO::PARAM_STR);
                        break;
                    case '`athlete_id`':
                        $stmt->bindValue($identifier, $this->athlete_id, PDO::PARAM_INT);
                        break;
                    case '`uploader_id`':
                        $stmt->bindValue($identifier, $this->uploader_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);
    }
666039
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(PageTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(PageTableMap::COL_SOURCE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'source_id';
        }
        if ($this->isColumnModified(PageTableMap::COL_PAGEID)) {
            $modifiedColumns[':p' . $index++]  = 'pageid';
        }
        if ($this->isColumnModified(PageTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = 'title';
        }
        if ($this->isColumnModified(PageTableMap::COL_DISPLAYTITLE)) {
            $modifiedColumns[':p' . $index++]  = 'displaytitle';
        }
        if ($this->isColumnModified(PageTableMap::COL_PAGE_IMAGE_FREE)) {
            $modifiedColumns[':p' . $index++]  = 'page_image_free';
        }
        if ($this->isColumnModified(PageTableMap::COL_WIKIBASE_ITEM)) {
            $modifiedColumns[':p' . $index++]  = 'wikibase_item';
        }
        if ($this->isColumnModified(PageTableMap::COL_DISAMBIGUATION)) {
            $modifiedColumns[':p' . $index++]  = 'disambiguation';
        }
        if ($this->isColumnModified(PageTableMap::COL_DEFAULTSORT)) {
            $modifiedColumns[':p' . $index++]  = 'defaultsort';
        }
        if ($this->isColumnModified(PageTableMap::COL_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'created_at';
        }
        if ($this->isColumnModified(PageTableMap::COL_UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'updated_at';
        }

        $sql = sprintf(
            'INSERT INTO page (%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 'source_id':
                        $stmt->bindValue($identifier, $this->source_id, PDO::PARAM_INT);
                        break;
                    case 'pageid':
                        $stmt->bindValue($identifier, $this->pageid, PDO::PARAM_INT);
                        break;
                    case 'title':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case 'displaytitle':
                        $stmt->bindValue($identifier, $this->displaytitle, PDO::PARAM_STR);
                        break;
                    case 'page_image_free':
                        $stmt->bindValue($identifier, $this->page_image_free, PDO::PARAM_STR);
                        break;
                    case 'wikibase_item':
                        $stmt->bindValue($identifier, $this->wikibase_item, PDO::PARAM_STR);
                        break;
                    case 'disambiguation':
                        $stmt->bindValue($identifier, $this->disambiguation, PDO::PARAM_STR);
                        break;
                    case 'defaultsort':
                        $stmt->bindValue($identifier, $this->defaultsort, PDO::PARAM_STR);
                        break;
                    case 'created_at':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'updated_at':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s.u") : 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);
    }
489740
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(MapTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(MapTableMap::COL_MAPUID)) {
            $modifiedColumns[':p' . $index++]  = 'mapUid';
        }
        if ($this->isColumnModified(MapTableMap::COL_NAME)) {
            $modifiedColumns[':p' . $index++]  = 'name';
        }
        if ($this->isColumnModified(MapTableMap::COL_FILENAME)) {
            $modifiedColumns[':p' . $index++]  = 'fileName';
        }
        if ($this->isColumnModified(MapTableMap::COL_AUTHOR)) {
            $modifiedColumns[':p' . $index++]  = 'author';
        }
        if ($this->isColumnModified(MapTableMap::COL_ENVIRONMENT)) {
            $modifiedColumns[':p' . $index++]  = 'environment';
        }
        if ($this->isColumnModified(MapTableMap::COL_MOOD)) {
            $modifiedColumns[':p' . $index++]  = 'mood';
        }
        if ($this->isColumnModified(MapTableMap::COL_BRONZETIME)) {
            $modifiedColumns[':p' . $index++]  = 'bronzeTime';
        }
        if ($this->isColumnModified(MapTableMap::COL_SILVERTIME)) {
            $modifiedColumns[':p' . $index++]  = 'silverTime';
        }
        if ($this->isColumnModified(MapTableMap::COL_GOLDTIME)) {
            $modifiedColumns[':p' . $index++]  = 'goldTime';
        }
        if ($this->isColumnModified(MapTableMap::COL_AUTHORTIME)) {
            $modifiedColumns[':p' . $index++]  = 'authorTime';
        }
        if ($this->isColumnModified(MapTableMap::COL_COPPERPRICE)) {
            $modifiedColumns[':p' . $index++]  = 'copperPrice';
        }
        if ($this->isColumnModified(MapTableMap::COL_LAPRACE)) {
            $modifiedColumns[':p' . $index++]  = 'lapRace';
        }
        if ($this->isColumnModified(MapTableMap::COL_NBLAPS)) {
            $modifiedColumns[':p' . $index++]  = 'nbLaps';
        }
        if ($this->isColumnModified(MapTableMap::COL_NPCHECKPOINTS)) {
            $modifiedColumns[':p' . $index++]  = 'npCheckpoints';
        }
        if ($this->isColumnModified(MapTableMap::COL_MAPTYPE)) {
            $modifiedColumns[':p' . $index++]  = 'mapType';
        }
        if ($this->isColumnModified(MapTableMap::COL_MAPSTYLE)) {
            $modifiedColumns[':p' . $index++]  = 'mapStyle';
        }
        if ($this->isColumnModified(MapTableMap::COL_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'created_at';
        }
        if ($this->isColumnModified(MapTableMap::COL_UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'updated_at';
        }

        $sql = sprintf(
            'INSERT INTO map (%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 'mapUid':
                        $stmt->bindValue($identifier, $this->mapuid, PDO::PARAM_STR);
                        break;
                    case 'name':
                        $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                        break;
                    case 'fileName':
                        $stmt->bindValue($identifier, $this->filename, PDO::PARAM_STR);
                        break;
                    case 'author':
                        $stmt->bindValue($identifier, $this->author, PDO::PARAM_STR);
                        break;
                    case 'environment':
                        $stmt->bindValue($identifier, $this->environment, PDO::PARAM_STR);
                        break;
                    case 'mood':
                        $stmt->bindValue($identifier, $this->mood, PDO::PARAM_STR);
                        break;
                    case 'bronzeTime':
                        $stmt->bindValue($identifier, $this->bronzetime, PDO::PARAM_INT);
                        break;
                    case 'silverTime':
                        $stmt->bindValue($identifier, $this->silvertime, PDO::PARAM_INT);
                        break;
                    case 'goldTime':
                        $stmt->bindValue($identifier, $this->goldtime, PDO::PARAM_INT);
                        break;
                    case 'authorTime':
                        $stmt->bindValue($identifier, $this->authortime, PDO::PARAM_INT);
                        break;
                    case 'copperPrice':
                        $stmt->bindValue($identifier, $this->copperprice, PDO::PARAM_INT);
                        break;
                    case 'lapRace':
                        $stmt->bindValue($identifier, (int) $this->laprace, PDO::PARAM_INT);
                        break;
                    case 'nbLaps':
                        $stmt->bindValue($identifier, $this->nblaps, PDO::PARAM_INT);
                        break;
                    case 'npCheckpoints':
                        $stmt->bindValue($identifier, $this->npcheckpoints, PDO::PARAM_INT);
                        break;
                    case 'mapType':
                        $stmt->bindValue($identifier, $this->maptype, PDO::PARAM_STR);
                        break;
                    case 'mapStyle':
                        $stmt->bindValue($identifier, $this->mapstyle, PDO::PARAM_STR);
                        break;
                    case 'created_at':
                        $stmt->bindValue($identifier, $this->created_at ? $this->created_at->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'updated_at':
                        $stmt->bindValue($identifier, $this->updated_at ? $this->updated_at->format("Y-m-d H:i:s.u") : 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);
    }
1371134
public function getUser(PropelPDO $con = null, $doQuery = true)
    {
        if ($this->aUser === null && ($this->user_id !== null) && $doQuery) {
            $this->aUser = UserQuery::create()->findPk($this->user_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->aUser->addUserRoles($this);
             */
        }

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

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(MxmapTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKUID)) {
            $modifiedColumns[':p' . $index++]  = 'trackUID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_GBXMAPNAME)) {
            $modifiedColumns[':p' . $index++]  = 'gbxMapName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKID)) {
            $modifiedColumns[':p' . $index++]  = 'trackID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_USERID)) {
            $modifiedColumns[':p' . $index++]  = 'userID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_USERNAME)) {
            $modifiedColumns[':p' . $index++]  = 'username';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UPLOADEDAT)) {
            $modifiedColumns[':p' . $index++]  = 'uploadedAt';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UPDATEDAT)) {
            $modifiedColumns[':p' . $index++]  = 'updatedAt';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_MAPTYPE)) {
            $modifiedColumns[':p' . $index++]  = 'mapType';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TITLEPACK)) {
            $modifiedColumns[':p' . $index++]  = 'titlePack';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_STYLENAME)) {
            $modifiedColumns[':p' . $index++]  = 'styleName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_DISPLAYCOST)) {
            $modifiedColumns[':p' . $index++]  = 'displayCost';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_MODNAME)) {
            $modifiedColumns[':p' . $index++]  = 'modName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LIGHTMAP)) {
            $modifiedColumns[':p' . $index++]  = 'lightMap';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EXEVERSION)) {
            $modifiedColumns[':p' . $index++]  = 'exeVersion';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EXEBUILD)) {
            $modifiedColumns[':p' . $index++]  = 'exeBuild';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_ENVIRONMENTNAME)) {
            $modifiedColumns[':p' . $index++]  = 'environmentName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_VEHICLENAME)) {
            $modifiedColumns[':p' . $index++]  = 'vehicleName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_UNLIMITERREQUIRED)) {
            $modifiedColumns[':p' . $index++]  = 'unlimiterRequired';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_ROUTENAME)) {
            $modifiedColumns[':p' . $index++]  = 'routeName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LENGTHNAME)) {
            $modifiedColumns[':p' . $index++]  = 'lengthName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_LAPS)) {
            $modifiedColumns[':p' . $index++]  = 'laps';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_DIFFICULTYNAME)) {
            $modifiedColumns[':p' . $index++]  = 'difficultyName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYTYPENAME)) {
            $modifiedColumns[':p' . $index++]  = 'replayTypeName';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRID)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRTIME)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRTime';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRUSERID)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRUserID';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYWRUSERNAME)) {
            $modifiedColumns[':p' . $index++]  = 'replayWRUsername';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_RATINGVOTECOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'ratingVoteCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_RATINGVOTEAVERAGE)) {
            $modifiedColumns[':p' . $index++]  = 'ratingVoteAverage';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_REPLAYCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'replayCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_TRACKVALUE)) {
            $modifiedColumns[':p' . $index++]  = 'trackValue';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_COMMENTS)) {
            $modifiedColumns[':p' . $index++]  = 'comments';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_COMMENTSCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'commentsCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_AWARDCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'awardCount';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASSCREENSHOT)) {
            $modifiedColumns[':p' . $index++]  = 'hasScreenshot';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASTHUMBNAIL)) {
            $modifiedColumns[':p' . $index++]  = 'hasThumbnail';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_HASGHOSTBLOCKS)) {
            $modifiedColumns[':p' . $index++]  = 'hasGhostblocks';
        }
        if ($this->isColumnModified(MxmapTableMap::COL_EMBEDDEDOBJECTSCOUNT)) {
            $modifiedColumns[':p' . $index++]  = 'embeddedObjectsCount';
        }

        $sql = sprintf(
            'INSERT INTO mxmap (%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 'trackUID':
                        $stmt->bindValue($identifier, $this->trackuid, PDO::PARAM_STR);
                        break;
                    case 'gbxMapName':
                        $stmt->bindValue($identifier, $this->gbxmapname, PDO::PARAM_STR);
                        break;
                    case 'trackID':
                        $stmt->bindValue($identifier, $this->trackid, PDO::PARAM_INT);
                        break;
                    case 'userID':
                        $stmt->bindValue($identifier, $this->userid, PDO::PARAM_INT);
                        break;
                    case 'username':
                        $stmt->bindValue($identifier, $this->username, PDO::PARAM_STR);
                        break;
                    case 'uploadedAt':
                        $stmt->bindValue($identifier, $this->uploadedat ? $this->uploadedat->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'updatedAt':
                        $stmt->bindValue($identifier, $this->updatedat ? $this->updatedat->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'mapType':
                        $stmt->bindValue($identifier, $this->maptype, PDO::PARAM_STR);
                        break;
                    case 'titlePack':
                        $stmt->bindValue($identifier, $this->titlepack, PDO::PARAM_STR);
                        break;
                    case 'styleName':
                        $stmt->bindValue($identifier, $this->stylename, PDO::PARAM_STR);
                        break;
                    case 'displayCost':
                        $stmt->bindValue($identifier, $this->displaycost, PDO::PARAM_INT);
                        break;
                    case 'modName':
                        $stmt->bindValue($identifier, $this->modname, PDO::PARAM_STR);
                        break;
                    case 'lightMap':
                        $stmt->bindValue($identifier, $this->lightmap, PDO::PARAM_INT);
                        break;
                    case 'exeVersion':
                        $stmt->bindValue($identifier, $this->exeversion, PDO::PARAM_STR);
                        break;
                    case 'exeBuild':
                        $stmt->bindValue($identifier, $this->exebuild, PDO::PARAM_STR);
                        break;
                    case 'environmentName':
                        $stmt->bindValue($identifier, $this->environmentname, PDO::PARAM_STR);
                        break;
                    case 'vehicleName':
                        $stmt->bindValue($identifier, $this->vehiclename, PDO::PARAM_STR);
                        break;
                    case 'unlimiterRequired':
                        $stmt->bindValue($identifier, (int) $this->unlimiterrequired, PDO::PARAM_INT);
                        break;
                    case 'routeName':
                        $stmt->bindValue($identifier, $this->routename, PDO::PARAM_STR);
                        break;
                    case 'lengthName':
                        $stmt->bindValue($identifier, $this->lengthname, PDO::PARAM_STR);
                        break;
                    case 'laps':
                        $stmt->bindValue($identifier, $this->laps, PDO::PARAM_INT);
                        break;
                    case 'difficultyName':
                        $stmt->bindValue($identifier, $this->difficultyname, PDO::PARAM_STR);
                        break;
                    case 'replayTypeName':
                        $stmt->bindValue($identifier, $this->replaytypename, PDO::PARAM_STR);
                        break;
                    case 'replayWRID':
                        $stmt->bindValue($identifier, $this->replaywrid, PDO::PARAM_INT);
                        break;
                    case 'replayWRTime':
                        $stmt->bindValue($identifier, $this->replaywrtime, PDO::PARAM_INT);
                        break;
                    case 'replayWRUserID':
                        $stmt->bindValue($identifier, $this->replaywruserid, PDO::PARAM_INT);
                        break;
                    case 'replayWRUsername':
                        $stmt->bindValue($identifier, $this->replaywrusername, PDO::PARAM_STR);
                        break;
                    case 'ratingVoteCount':
                        $stmt->bindValue($identifier, $this->ratingvotecount, PDO::PARAM_INT);
                        break;
                    case 'ratingVoteAverage':
                        $stmt->bindValue($identifier, $this->ratingvoteaverage, PDO::PARAM_STR);
                        break;
                    case 'replayCount':
                        $stmt->bindValue($identifier, $this->replaycount, PDO::PARAM_INT);
                        break;
                    case 'trackValue':
                        $stmt->bindValue($identifier, $this->trackvalue, PDO::PARAM_INT);
                        break;
                    case 'comments':
                        $stmt->bindValue($identifier, $this->comments, PDO::PARAM_STR);
                        break;
                    case 'commentsCount':
                        $stmt->bindValue($identifier, $this->commentscount, PDO::PARAM_INT);
                        break;
                    case 'awardCount':
                        $stmt->bindValue($identifier, $this->awardcount, PDO::PARAM_INT);
                        break;
                    case 'hasScreenshot':
                        $stmt->bindValue($identifier, (int) $this->hasscreenshot, PDO::PARAM_INT);
                        break;
                    case 'hasThumbnail':
                        $stmt->bindValue($identifier, (int) $this->hasthumbnail, PDO::PARAM_INT);
                        break;
                    case 'hasGhostblocks':
                        $stmt->bindValue($identifier, (int) $this->hasghostblocks, PDO::PARAM_INT);
                        break;
                    case 'embeddedObjectsCount':
                        $stmt->bindValue($identifier, $this->embeddedobjectscount, 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);
    }
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;
        }
    }
1312962
protected function doInsert(PropelPDO $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(ApiLogPeer::ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(ApiLogPeer::DT_CALL)) {
            $modifiedColumns[':p' . $index++]  = '`dt_call`';
        }
        if ($this->isColumnModified(ApiLogPeer::REMOTE_APP_ID)) {
            $modifiedColumns[':p' . $index++]  = '`remote_app_id`';
        }
        if ($this->isColumnModified(ApiLogPeer::STATUSCODE)) {
            $modifiedColumns[':p' . $index++]  = '`statuscode`';
        }
        if ($this->isColumnModified(ApiLogPeer::LAST_RESPONSE)) {
            $modifiedColumns[':p' . $index++]  = '`last_response`';
        }

        $sql = sprintf(
            'INSERT INTO `api_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 '`dt_call`':
                        $stmt->bindValue($identifier, $this->dt_call, PDO::PARAM_STR);
                        break;
                    case '`remote_app_id`':
                        $stmt->bindValue($identifier, $this->remote_app_id, PDO::PARAM_INT);
                        break;
                    case '`statuscode`':
                        $stmt->bindValue($identifier, $this->statuscode, PDO::PARAM_INT);
                        break;
                    case '`last_response`':
                        if (is_resource($this->last_response)) {
                            rewind($this->last_response);
                        }
                        $stmt->bindValue($identifier, $this->last_response, PDO::PARAM_LOB);
                        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);
    }
879861
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

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

        $sql = sprintf(
            'INSERT INTO index_engine_driver_configuration (%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 'DRIVER_CODE':
                        $stmt->bindValue($identifier, $this->driver_code, PDO::PARAM_STR);
                        break;
                    case 'TITLE':
                        $stmt->bindValue($identifier, $this->title, PDO::PARAM_STR);
                        break;
                    case 'SERIALIZED_CONFIGURATION':
                        $stmt->bindValue($identifier, $this->serialized_configuration, 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);
    }
796832
protected function doInsert(PropelPDO $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(UserCustomerRelationPeer::ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(UserCustomerRelationPeer::USER_ID)) {
            $modifiedColumns[':p' . $index++]  = '`user_id`';
        }
        if ($this->isColumnModified(UserCustomerRelationPeer::CUSTOMER_ID)) {
            $modifiedColumns[':p' . $index++]  = '`customer_id`';
        }

        $sql = sprintf(
            'INSERT INTO `user_customer_relation` (%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 '`user_id`':
                        $stmt->bindValue($identifier, $this->user_id, PDO::PARAM_INT);
                        break;
                    case '`customer_id`':
                        $stmt->bindValue($identifier, $this->customer_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), $e);
        }

        try {
            $pk = $con->lastInsertId();
        } catch (Exception $e) {
            throw new PropelException('Unable to get autoincrement id.', $e);
        }
        $this->setId($pk);

        $this->setNew(false);
    }