示例#1
0
文件: Sequence.php 项目: kafruhs/fws
 private function _updateExistingSequence()
 {
     $table = DB::table('sequence');
     $statement = new base_database_statement_Update();
     $statement->setTable($table);
     $statement->setColumnValue($table->getColumn('num'), DB::term($this->nextSeq));
     $where = DB::where($table->getColumn('class'), DB::term($this->class));
     $statement->setWhere($where);
     $statement->insertDatabase();
 }
示例#2
0
 /**
  * set existing actual revision of the object to self::HISTORIC
  *
  * @param $table
  * @param $historicValue
  * @return base_database_statement_Update
  * @throws base_database_Exception
  */
 private function _setHistoricData(base_database_Table $table, $historicValue)
 {
     $statement = new base_database_statement_Update();
     $where = DB::where($table->getColumn('histtop'), DB::term(self::ACTUAL));
     $where->addAnd($table->getColumn('LK'), DB::intTerm((int) $this['LK']));
     $statement->setTable($table);
     $statement->setWhere($where);
     $statement->setColumnValue($table->getColumn('histtop'), DB::term($historicValue));
     $statement->insertDatabase();
 }
示例#3
0
文件: CSV.php 项目: kafruhs/fws
 /**
  * @param $result
  * @return base_database_statement_Insert|base_database_statement_Update
  * @throws base_database_Exception
  */
 protected function getStatementForImport($result)
 {
     if (empty($result)) {
         $statement = new base_database_statement_Insert();
         return $statement;
     } else {
         $statement = new base_database_statement_Update();
         $colPK = $this->table->getColumn('PK');
         $statement->setWhere(DB::where($colPK, DB::intTerm($result)));
         return $statement;
     }
 }
示例#4
0
文件: User.php 项目: kafruhs/fws
    /**
     * update the user login data like ip, sessionid and last login timestamp
     *
     * @param base_database_Table $table
     * @param base_database_Where $where
     * @param array               $fieldsWithValues
     * @throws base_database_Exception
     */
    private static function _updateUserLoginData(base_database_Table $table, base_database_Where $where, array $fieldsWithValues)
    {
        $updateStatement = new base_database_statement_Update();
        $updateStatement->setTable($table);

        foreach ($fieldsWithValues as $field => $value) {
            $updateStatement->setColumnValue($table->getColumn($field), $value);
        }
        $updateStatement->setWhere($where);

        DB::beginTransaction();
        $updateStatement->insertDatabase();
        DB::endTransaction();
    }