Exemplo n.º 1
0
 function update($set, $criteria = null)
 {
     if (is_array($set)) {
         $set = $this->_filterRow($set);
     }
     $query = new lmbUpdateQuery($this->_db_table_name, $this->_conn);
     if ($criteria) {
         $query->addCriteria($criteria);
     }
     if (is_array($set)) {
         foreach (array_keys($set) as $key) {
             $query->addField($key);
         }
         $this->_stmt = $query->getStatement();
         $this->_bindValuesToStatement($this->_stmt, $set);
         return $this->_stmt->execute();
     } else {
         $query->addRawField($set);
         $this->_stmt = $query->getStatement();
         return $this->_stmt->execute();
     }
 }