Beispiel #1
0
 /**
  * @param  $sets
  * @param  $where
  * @return int
  */
 public function update($sets, $where)
 {
     DBTable::clearCache();
     $sets = $this->objToRel($sets);
     // This allows for dummy columns to be part of the object without the
     // DAO automatically accessing them in the queries.
     if ($this->ignoreCols != null) {
         foreach ($this->ignoreCols as $ignoreCol) {
             unset($sets[$ignoreCol]);
         }
     }
     $params = [];
     $sql = 'UPDATE ' . $this->tableName . ' ' . 'SET ' . join('=?, ', array_keys($sets)) . '=? ' . $this->toWhere($where, $params);
     return DB::exec($this->db, $sql, array_merge(array_values($sets), $params));
 }