Save all the elements in the collection

@param PropelPDO $con

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

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(RoleTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = 'ID';
        }
        if ($this->isColumnModified(RoleTableMap::COL_NAME)) {
            $modifiedColumns[':p' . $index++]  = 'NAME';
        }
        if ($this->isColumnModified(RoleTableMap::COL_DESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = 'DESCRIPTION';
        }
        if ($this->isColumnModified(RoleTableMap::COL_CREATE_DATE)) {
            $modifiedColumns[':p' . $index++]  = 'CREATE_DATE';
        }
        if ($this->isColumnModified(RoleTableMap::COL_UPDATE_DATE)) {
            $modifiedColumns[':p' . $index++]  = 'UPDATE_DATE';
        }
        if ($this->isColumnModified(RoleTableMap::COL_STATUS)) {
            $modifiedColumns[':p' . $index++]  = 'STATUS';
        }

        $sql = sprintf(
            'INSERT INTO role (%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 'NAME':
                        $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
                        break;
                    case 'DESCRIPTION':
                        $stmt->bindValue($identifier, $this->description, PDO::PARAM_STR);
                        break;
                    case 'CREATE_DATE':
                        $stmt->bindValue($identifier, $this->create_date ? $this->create_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'UPDATE_DATE':
                        $stmt->bindValue($identifier, $this->update_date ? $this->update_date->format("Y-m-d H:i:s") : null, PDO::PARAM_STR);
                        break;
                    case 'STATUS':
                        $stmt->bindValue($identifier, $this->status, 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);
    }
762093
protected function doInsert(ConnectionInterface $con)
    {
        $modifiedColumns = array();
        $index = 0;


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

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

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

        $this->setNew(false);
    }
857252
protected final function save($data, $con = null, $cb = null) {
        if (!$con) {
            return $this->insert($data, $cb);
        } else if ($this->exist($con)) {//存在即修改
            return $this->update($data, $con, $cb);
        } else {
            return $this->insert($data, $cb);
        }
    }
361960
public function insertAtBottom(ConnectionInterface $con = null)
    {
        $this->setPosition(ChildCustomerGroupQuery::create()->getMaxRankArray($con) + 1);

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

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

         // check the columns in natural order for more readable SQL queries
        if ($this->isColumnModified(GroupTableMap::COL_ID)) {
            $modifiedColumns[':p' . $index++]  = '`id`';
        }
        if ($this->isColumnModified(GroupTableMap::COL_TITLE)) {
            $modifiedColumns[':p' . $index++]  = '`title`';
        }
        if ($this->isColumnModified(GroupTableMap::COL_DESCRIPTION)) {
            $modifiedColumns[':p' . $index++]  = '`description`';
        }
        if ($this->isColumnModified(GroupTableMap::COL_SLUG)) {
            $modifiedColumns[':p' . $index++]  = '`slug`';
        }
        if ($this->isColumnModified(GroupTableMap::COL_SPORT_ID)) {
            $modifiedColumns[':p' . $index++]  = '`sport_id`';
        }
        if ($this->isColumnModified(GroupTableMap::COL_SKILL_COUNT)) {
            $modifiedColumns[':p' . $index++]  = '`skill_count`';
        }

        $sql = sprintf(
            'INSERT INTO `kk_trixionary_group` (%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 '`slug`':
                        $stmt->bindValue($identifier, $this->slug, PDO::PARAM_STR);
                        break;
                    case '`sport_id`':
                        $stmt->bindValue($identifier, $this->sport_id, PDO::PARAM_INT);
                        break;
                    case '`skill_count`':
                        $stmt->bindValue($identifier, $this->skill_count, 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);
    }
591298
protected function processSortableQueries($con)
    {
        foreach ($this->sortableQueries as $query) {
            $query['arguments'][]= $con;
            call_user_func_array($query['callable'], $query['arguments']);
        }
        $this->sortableQueries = array();
    }
794318
protected function doSelect($con)
    {
        // check that the columns of the main class are already added (if this is the primary ModelCriteria)
        if (!$this->hasSelectClause() && !$this->getPrimaryCriteria()) {
            $this->addSelfSelectColumns();
        }
        $this->configureSelectColumns();

        $dbMap = Propel::getDatabaseMap($this->getDbName());
        $db = Propel::getDB($this->getDbName());

        $params = array();
        $sql = BasePeer::createSelectSql($this, $params);
        try {
            $stmt = $con->prepare($sql);
            $db->bindValues($stmt, $params, $dbMap);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }

        return $stmt;
    }
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);
    }
234955
public static function doDeleteAll(PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(UserPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
        }
        $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 += UserPeer::doOnDeleteCascade(new Criteria(UserPeer::DATABASE_NAME), $con);
            $affectedRows += BasePeer::doDeleteAll(UserPeer::TABLE_NAME, $con, UserPeer::DATABASE_NAME);
            // 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).
            UserPeer::clearInstancePool();
            UserPeer::clearRelatedInstancePool();
            $con->commit();

            return $affectedRows;
        } catch (Exception $e) {
            $con->rollBack();
            throw $e;
        }
    }
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);
    }
48826
public function delete(PropelPDO $con = null)
    {
        if ($this->isDeleted()) {
            throw new PropelException("This object has already been deleted.");
        }

        if ($con === null) {
            $con = Propel::getConnection(ApiLogPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
        }

        $con->beginTransaction();
        try {
            $deleteQuery = ApiLogQuery::create()
                ->filterByPrimaryKey($this->getPrimaryKey());
            $ret = $this->preDelete($con);
            if ($ret) {
                $deleteQuery->delete($con);
                $this->postDelete($con);
                $con->commit();
                $this->setDeleted(true);
            } else {
                $con->commit();
            }
        } catch (Exception $e) {
            $con->rollBack();
            throw $e;
        }
    }
390460
protected function doInsert(PropelPDO $con)
    {
        $modifiedColumns = array();
        $index = 0;


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

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

        try {
            $stmt = $con->prepare($sql);
            foreach ($modifiedColumns as $identifier => $columnName) {
                switch ($columnName) {
                    case '`user_id`':
                        $stmt->bindValue($identifier, $this->user_id, PDO::PARAM_INT);
                        break;
                    case '`role_id`':
                        $stmt->bindValue($identifier, $this->role_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);
        }

        $this->setNew(false);
    }
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;
    }
1161621
public function getCustomer(PropelPDO $con = null, $doQuery = true)
    {
        if ($this->aCustomer === null && ($this->customer_id !== null) && $doQuery) {
            $this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aCustomer->addUserCustomerRelations($this);
             */
        }

        return $this->aCustomer;
    }
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);
    }