Insert the row in the database.

@param      ConnectionInterface $con

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


         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(DealerVersionTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(DealerVersionTableMap::VISIBLE)) {
            $modifiedColumns[':p' . $index++]  = 'VISIBLE';
        }
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS1)) {
            $modifiedColumns[':p' . $index++]  = 'ADDRESS1';
        }
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS2)) {
            $modifiedColumns[':p' . $index++]  = 'ADDRESS2';
        }
        if ($this->isColumnModified(DealerVersionTableMap::ADDRESS3)) {
            $modifiedColumns[':p' . $index++]  = 'ADDRESS3';
        }
        if ($this->isColumnModified(DealerVersionTableMap::ZIPCODE)) {
            $modifiedColumns[':p' . $index++]  = 'ZIPCODE';
        }
        if ($this->isColumnModified(DealerVersionTableMap::CITY)) {
            $modifiedColumns[':p' . $index++]  = 'CITY';
        }
        if ($this->isColumnModified(DealerVersionTableMap::COUNTRY_ID)) {
            $modifiedColumns[':p' . $index++]  = 'COUNTRY_ID';
        }
        if ($this->isColumnModified(DealerVersionTableMap::LATITUDE)) {
            $modifiedColumns[':p' . $index++]  = 'LATITUDE';
        }
        if ($this->isColumnModified(DealerVersionTableMap::LONGITUDE)) {
            $modifiedColumns[':p' . $index++]  = 'LONGITUDE';
        }
        if ($this->isColumnModified(DealerVersionTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(DealerVersionTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }
        if ($this->isColumnModified(DealerVersionTableMap::VERSION)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION';
        }
        if ($this->isColumnModified(DealerVersionTableMap::VERSION_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_AT';
        }
        if ($this->isColumnModified(DealerVersionTableMap::VERSION_CREATED_BY)) {
            $modifiedColumns[':p' . $index++]  = 'VERSION_CREATED_BY';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_SHEDULES_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_SHEDULES_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_SHEDULES_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_SHEDULES_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTACT_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_CONTACT_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTACT_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_CONTACT_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTENT_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_CONTENT_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_CONTENT_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_CONTENT_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_FOLDER_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_FOLDER_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_FOLDER_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_FOLDER_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_BRAND_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_BRAND_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_BRAND_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_BRAND_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_PRODUCT_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_PRODUCT_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_PRODUCT_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_PRODUCT_VERSIONS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_ADMIN_IDS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_ADMIN_IDS';
        }
        if ($this->isColumnModified(DealerVersionTableMap::DEALER_ADMIN_VERSIONS)) {
            $modifiedColumns[':p' . $index++]  = 'DEALER_ADMIN_VERSIONS';
        }

        $sql = sprintf(
            'INSERT INTO dealer_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 'VISIBLE':
                        $stmt->bindValue($identifier, $this->visible, PDO::PARAM_INT);
                        break;
                    case 'ADDRESS1':
                        $stmt->bindValue($identifier, $this->address1, PDO::PARAM_STR);
                        break;
                    case 'ADDRESS2':
                        $stmt->bindValue($identifier, $this->address2, PDO::PARAM_STR);
                        break;
                    case 'ADDRESS3':
                        $stmt->bindValue($identifier, $this->address3, PDO::PARAM_STR);
                        break;
                    case 'ZIPCODE':
                        $stmt->bindValue($identifier, $this->zipcode, PDO::PARAM_STR);
                        break;
                    case 'CITY':
                        $stmt->bindValue($identifier, $this->city, PDO::PARAM_STR);
                        break;
                    case 'COUNTRY_ID':
                        $stmt->bindValue($identifier, $this->country_id, PDO::PARAM_INT);
                        break;
                    case 'LATITUDE':
                        $stmt->bindValue($identifier, $this->latitude, PDO::PARAM_STR);
                        break;
                    case 'LONGITUDE':
                        $stmt->bindValue($identifier, $this->longitude, 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 'DEALER_SHEDULES_IDS':
                        $stmt->bindValue($identifier, $this->dealer_shedules_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_SHEDULES_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_shedules_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_CONTACT_IDS':
                        $stmt->bindValue($identifier, $this->dealer_contact_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_CONTACT_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_contact_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_CONTENT_IDS':
                        $stmt->bindValue($identifier, $this->dealer_content_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_CONTENT_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_content_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_FOLDER_IDS':
                        $stmt->bindValue($identifier, $this->dealer_folder_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_FOLDER_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_folder_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_BRAND_IDS':
                        $stmt->bindValue($identifier, $this->dealer_brand_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_BRAND_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_brand_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_PRODUCT_IDS':
                        $stmt->bindValue($identifier, $this->dealer_product_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_PRODUCT_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_product_versions, PDO::PARAM_STR);
                        break;
                    case 'DEALER_ADMIN_IDS':
                        $stmt->bindValue($identifier, $this->dealer_admin_ids, PDO::PARAM_STR);
                        break;
                    case 'DEALER_ADMIN_VERSIONS':
                        $stmt->bindValue($identifier, $this->dealer_admin_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);
    }
400081
public function initConnection(ConnectionInterface $con, array $settings)
    {
        $con->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        $con->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES, false);

        parent::initConnection($con, $settings);
    }
605830
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

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

        $sql = sprintf(
            'INSERT INTO smarty_filter (%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 'ACTIVE':
                        $stmt->bindValue($identifier, $this->active, PDO::PARAM_INT);
                        break;
                    case 'FILTERTYPE':
                        $stmt->bindValue($identifier, $this->filtertype, PDO::PARAM_STR);
                        break;
                    case 'CODE':
                        $stmt->bindValue($identifier, $this->code, 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);
    }
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);
    }
1169738
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(RecordTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(RecordTableMap::COL_MAPUID)) {
            $modifiedColumns[':p' . $index++]  = 'mapUid';
        }
        if ($this->isColumnModified(RecordTableMap::COL_NBLAPS)) {
            $modifiedColumns[':p' . $index++]  = 'nbLaps';
        }
        if ($this->isColumnModified(RecordTableMap::COL_SCORE)) {
            $modifiedColumns[':p' . $index++]  = 'score';
        }
        if ($this->isColumnModified(RecordTableMap::COL_NBFINISH)) {
            $modifiedColumns[':p' . $index++]  = 'nbFinish';
        }
        if ($this->isColumnModified(RecordTableMap::COL_AVGSCORE)) {
            $modifiedColumns[':p' . $index++]  = 'avgScore';
        }
        if ($this->isColumnModified(RecordTableMap::COL_CHECKPOINTS)) {
            $modifiedColumns[':p' . $index++]  = 'checkpoints';
        }
        if ($this->isColumnModified(RecordTableMap::COL_PLAYER_ID)) {
            $modifiedColumns[':p' . $index++]  = 'player_id';
        }
        if ($this->isColumnModified(RecordTableMap::COL_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'created_at';
        }
        if ($this->isColumnModified(RecordTableMap::COL_UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'updated_at';
        }

        $sql = sprintf(
            'INSERT INTO record (%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 'nbLaps':
                        $stmt->bindValue($identifier, $this->nblaps, PDO::PARAM_INT);
                        break;
                    case 'score':
                        $stmt->bindValue($identifier, $this->score, PDO::PARAM_INT);
                        break;
                    case 'nbFinish':
                        $stmt->bindValue($identifier, $this->nbfinish, PDO::PARAM_INT);
                        break;
                    case 'avgScore':
                        $stmt->bindValue($identifier, $this->avgscore, PDO::PARAM_INT);
                        break;
                    case 'checkpoints':
                        $stmt->bindValue($identifier, $this->checkpoints, PDO::PARAM_STR);
                        break;
                    case 'player_id':
                        $stmt->bindValue($identifier, $this->player_id, PDO::PARAM_INT);
                        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);
    }
821382
protected function doUpdate(ConnectionInterface $con)
    {
        $selectCriteria = $this->buildPkeyCriteria();
        $valuesCriteria = $this->buildCriteria();

        return $selectCriteria->doUpdate($valuesCriteria, $con);
    }
1207758
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


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

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

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case 'CUSTOMER_ID':
                        $stmt->bindValue($identifier, $this->customer_id, PDO::PARAM_INT);
                        break;
                    case 'CUSTOMER_GROUP_ID':
                        $stmt->bindValue($identifier, $this->customer_group_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);
    }
469365
public function exists(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getReadConnection($this->getDbName());
        }

        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $criteria->setDbName($this->getDbName()); // Set the correct dbName
        $criteria->clearOrderByColumns(); // ORDER BY will do nothing but slow down the query
        $criteria->clearSelectColumns(); // We are not retrieving data
        $criteria->addSelectColumn('1');
        $criteria->limit(1);

        // We need to set the primary table name, since in the case that there are no WHERE columns
        // it will be impossible for the createSelectSql() method to determine which
        // tables go into the FROM clause.
        $criteria->setPrimaryTableName(constant($this->modelTableMapName . '::TABLE_NAME'));

        $dataFetcher = $criteria->doSelect($con);
        $exists = (boolean) $dataFetcher->fetchColumn(0);
        $dataFetcher->close();

        return $exists;
    }
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);
    }
868089
public function doDeleteAll(ConnectionInterface $con = null)
    {
        if (null === $con) {
            $con = Propel::getServiceContainer()->getWriteConnection(DealerContactVersionTableMap::DATABASE_NAME);
        }
        $affectedRows = 0; // initialize var to track total num of affected rows
        try {
            // use transaction because $criteria could contain info
            // for more than one table or we could emulating ON DELETE CASCADE, etc.
            $con->beginTransaction();
            $affectedRows += parent::doDeleteAll($con);
            // Because this db requires some delete cascade/set null emulation, we have to
            // clear the cached instance *after* the emulation has happened (since
            // instances get re-added by the select statement contained therein).
            DealerContactVersionTableMap::clearInstancePool();
            DealerContactVersionTableMap::clearRelatedInstancePool();

            $con->commit();
        } catch (PropelException $e) {
            $con->rollBack();
            throw $e;
        }

        return $affectedRows;
    }
725383
protected function processNestedSetQueries(ConnectionInterface $con)
    {
        foreach ($this->nestedSetQueries as $query) {
            $query['arguments'][] = $con;
            call_user_func_array($query['callable'], $query['arguments']);
        }
        $this->nestedSetQueries = array();
    }
1344546
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


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

        $sql = sprintf(
            'INSERT INTO team_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 '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_TEAM_LINK_IDS':
                        $stmt->bindValue($identifier, $this->person_team_link_ids, PDO::PARAM_STR);
                        break;
                    case 'PERSON_TEAM_LINK_VERSIONS':
                        $stmt->bindValue($identifier, $this->person_team_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);
    }
1290333
private function insertRow($tableName, Connection $connection, array $data, Closure $getColumnType): void
    {
        $types        = [];
        $quotedFields = [];
        foreach ($data as $column => $value) {
            $name                = $connection->quoteIdentifier($column);
            $quotedFields[$name] = $value;
            $types[$name]        = $getColumnType($column);
        }

        try {
            $result = $connection->insert($tableName, $quotedFields, $types);
            assert($result !== false, 'Insert failed');
        } /** @noinspection PhpRedundantCatchClauseInspection */ catch (UniqueConstraintViolationException $e) {
            // ignore non-unique records
        }
    }
953293
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::ATTRIBUTE_AV_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ATTRIBUTE_AV_ID';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::ATTRIBUTE_ATTRIBUTE_TYPE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ATTRIBUTE_ATTRIBUTE_TYPE_ID';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::LOCALE)) {
            $modifiedColumns[':p' . $index++]  = 'LOCALE';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::VALUE)) {
            $modifiedColumns[':p' . $index++]  = 'VALUE';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'CREATED_AT';
        }
        if ($this->isColumnModified(AttributeTypeAvMetaTableMap::UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATED_AT';
        }

        $sql = sprintf(
            'INSERT INTO attribute_type_av_meta (%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_AV_ID':
                        $stmt->bindValue($identifier, $this->attribute_av_id, PDO::PARAM_INT);
                        break;
                    case 'ATTRIBUTE_ATTRIBUTE_TYPE_ID':
                        $stmt->bindValue($identifier, $this->attribute_attribute_type_id, PDO::PARAM_INT);
                        break;
                    case 'LOCALE':
                        $stmt->bindValue($identifier, $this->locale, PDO::PARAM_STR);
                        break;
                    case 'VALUE':
                        $stmt->bindValue($identifier, $this->value, 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);
    }
1175276
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(MediaTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'id';
        }
        if ($this->isColumnModified(MediaTableMap::COL_SOURCE_ID)) {
            $modifiedColumns[':p' . $index++]  = 'source_id';
        }
        if ($this->isColumnModified(MediaTableMap::COL_PAGEID)) {
            $modifiedColumns[':p' . $index++]  = 'pageid';
        }
        if ($this->isColumnModified(MediaTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = 'title';
        }
        if ($this->isColumnModified(MediaTableMap::COL_URL)) {
            $modifiedColumns[':p' . $index++]  = 'url';
        }
        if ($this->isColumnModified(MediaTableMap::COL_MIME)) {
            $modifiedColumns[':p' . $index++]  = 'mime';
        }
        if ($this->isColumnModified(MediaTableMap::COL_WIDTH)) {
            $modifiedColumns[':p' . $index++]  = 'width';
        }
        if ($this->isColumnModified(MediaTableMap::COL_HEIGHT)) {
            $modifiedColumns[':p' . $index++]  = 'height';
        }
        if ($this->isColumnModified(MediaTableMap::COL_SIZE)) {
            $modifiedColumns[':p' . $index++]  = 'size';
        }
        if ($this->isColumnModified(MediaTableMap::COL_SHA1)) {
            $modifiedColumns[':p' . $index++]  = 'sha1';
        }
        if ($this->isColumnModified(MediaTableMap::COL_THUMBURL)) {
            $modifiedColumns[':p' . $index++]  = 'thumburl';
        }
        if ($this->isColumnModified(MediaTableMap::COL_THUMBMIME)) {
            $modifiedColumns[':p' . $index++]  = 'thumbmime';
        }
        if ($this->isColumnModified(MediaTableMap::COL_THUMBWIDTH)) {
            $modifiedColumns[':p' . $index++]  = 'thumbwidth';
        }
        if ($this->isColumnModified(MediaTableMap::COL_THUMBHEIGHT)) {
            $modifiedColumns[':p' . $index++]  = 'thumbheight';
        }
        if ($this->isColumnModified(MediaTableMap::COL_THUMBSIZE)) {
            $modifiedColumns[':p' . $index++]  = 'thumbsize';
        }
        if ($this->isColumnModified(MediaTableMap::COL_DESCRIPTIONURL)) {
            $modifiedColumns[':p' . $index++]  = 'descriptionurl';
        }
        if ($this->isColumnModified(MediaTableMap::COL_DESCRIPTIONURLSHORT)) {
            $modifiedColumns[':p' . $index++]  = 'descriptionurlshort';
        }
        if ($this->isColumnModified(MediaTableMap::COL_IMAGEDESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = 'imagedescription';
        }
        if ($this->isColumnModified(MediaTableMap::COL_DATETIMEORIGINAL)) {
            $modifiedColumns[':p' . $index++]  = 'datetimeoriginal';
        }
        if ($this->isColumnModified(MediaTableMap::COL_ARTIST)) {
            $modifiedColumns[':p' . $index++]  = 'artist';
        }
        if ($this->isColumnModified(MediaTableMap::COL_LICENSESHORTNAME)) {
            $modifiedColumns[':p' . $index++]  = 'licenseshortname';
        }
        if ($this->isColumnModified(MediaTableMap::COL_USAGETERMS)) {
            $modifiedColumns[':p' . $index++]  = 'usageterms';
        }
        if ($this->isColumnModified(MediaTableMap::COL_ATTRIBUTIONREQUIRED)) {
            $modifiedColumns[':p' . $index++]  = 'attributionrequired';
        }
        if ($this->isColumnModified(MediaTableMap::COL_RESTRICTIONS)) {
            $modifiedColumns[':p' . $index++]  = 'restrictions';
        }
        if ($this->isColumnModified(MediaTableMap::COL_TIMESTAMP)) {
            $modifiedColumns[':p' . $index++]  = 'timestamp';
        }
        if ($this->isColumnModified(MediaTableMap::COL_USER)) {
            $modifiedColumns[':p' . $index++]  = 'user';
        }
        if ($this->isColumnModified(MediaTableMap::COL_USERID)) {
            $modifiedColumns[':p' . $index++]  = 'userid';
        }
        if ($this->isColumnModified(MediaTableMap::COL_MISSING)) {
            $modifiedColumns[':p' . $index++]  = 'missing';
        }
        if ($this->isColumnModified(MediaTableMap::COL_KNOWN)) {
            $modifiedColumns[':p' . $index++]  = 'known';
        }
        if ($this->isColumnModified(MediaTableMap::COL_IMAGEREPOSITORY)) {
            $modifiedColumns[':p' . $index++]  = 'imagerepository';
        }
        if ($this->isColumnModified(MediaTableMap::COL_CREATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'created_at';
        }
        if ($this->isColumnModified(MediaTableMap::COL_UPDATED_AT)) {
            $modifiedColumns[':p' . $index++]  = 'updated_at';
        }

        $sql = sprintf(
            'INSERT INTO media (%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 'url':
                        $stmt->bindValue($identifier, $this->url, PDO::PARAM_STR);
                        break;
                    case 'mime':
                        $stmt->bindValue($identifier, $this->mime, PDO::PARAM_STR);
                        break;
                    case 'width':
                        $stmt->bindValue($identifier, $this->width, PDO::PARAM_INT);
                        break;
                    case 'height':
                        $stmt->bindValue($identifier, $this->height, PDO::PARAM_INT);
                        break;
                    case 'size':
                        $stmt->bindValue($identifier, $this->size, PDO::PARAM_INT);
                        break;
                    case 'sha1':
                        $stmt->bindValue($identifier, $this->sha1, PDO::PARAM_STR);
                        break;
                    case 'thumburl':
                        $stmt->bindValue($identifier, $this->thumburl, PDO::PARAM_STR);
                        break;
                    case 'thumbmime':
                        $stmt->bindValue($identifier, $this->thumbmime, PDO::PARAM_STR);
                        break;
                    case 'thumbwidth':
                        $stmt->bindValue($identifier, $this->thumbwidth, PDO::PARAM_INT);
                        break;
                    case 'thumbheight':
                        $stmt->bindValue($identifier, $this->thumbheight, PDO::PARAM_INT);
                        break;
                    case 'thumbsize':
                        $stmt->bindValue($identifier, $this->thumbsize, PDO::PARAM_INT);
                        break;
                    case 'descriptionurl':
                        $stmt->bindValue($identifier, $this->descriptionurl, PDO::PARAM_STR);
                        break;
                    case 'descriptionurlshort':
                        $stmt->bindValue($identifier, $this->descriptionurlshort, PDO::PARAM_STR);
                        break;
                    case 'imagedescription':
                        $stmt->bindValue($identifier, $this->imagedescription, PDO::PARAM_STR);
                        break;
                    case 'datetimeoriginal':
                        $stmt->bindValue($identifier, $this->datetimeoriginal, PDO::PARAM_STR);
                        break;
                    case 'artist':
                        $stmt->bindValue($identifier, $this->artist, PDO::PARAM_STR);
                        break;
                    case 'licenseshortname':
                        $stmt->bindValue($identifier, $this->licenseshortname, PDO::PARAM_STR);
                        break;
                    case 'usageterms':
                        $stmt->bindValue($identifier, $this->usageterms, PDO::PARAM_STR);
                        break;
                    case 'attributionrequired':
                        $stmt->bindValue($identifier, $this->attributionrequired, PDO::PARAM_STR);
                        break;
                    case 'restrictions':
                        $stmt->bindValue($identifier, $this->restrictions, PDO::PARAM_STR);
                        break;
                    case 'timestamp':
                        $stmt->bindValue($identifier, $this->timestamp ? $this->timestamp->format("Y-m-d H:i:s.u") : null, PDO::PARAM_STR);
                        break;
                    case 'user':
                        $stmt->bindValue($identifier, $this->user, PDO::PARAM_STR);
                        break;
                    case 'userid':
                        $stmt->bindValue($identifier, $this->userid, PDO::PARAM_INT);
                        break;
                    case 'missing':
                        $stmt->bindValue($identifier, $this->missing, PDO::PARAM_BOOL);
                        break;
                    case 'known':
                        $stmt->bindValue($identifier, $this->known, PDO::PARAM_BOOL);
                        break;
                    case 'imagerepository':
                        $stmt->bindValue($identifier, $this->imagerepository, 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);
    }
867977
public function insertAllData($con, $tableName = null)
    {
        try {
            $this->validate(['con' => $con, 'tableName' => $tableName]);
            $query = null;
            
            if ($this->queryChanged) {
                $query = $this->selectQuery;
            } else {
                $query = $this->selectQuery.$tableName;
            }

            $allData = $this->con->getData($con, $query);
            $params = null;
            foreach ($allData as $key => $data) {
                $params['body'][] = array(
                    'index' => array(
                        '_index' => $this->client->getIndex(),
                        '_type'  => $this->client->getType(),
                        '_id'    => $data[$this->idColumn],
                    ),
                );
                $params['body'][] = $data;
            }
            $responses = $this->client->getClient()->bulk($params);
            return $responses;
        } catch (\Elasticsearch\Common\Exceptions\NoNodesAvailableException $ex) {
            throw new SyncMySqlExceptions("Check your elasticsearch connetion");
        }
    }