Exemplo n.º 1
0
 /**
  * Actualizar registros
  *
  * @param  array          $field
  * @param  string         $where  condiciones
  * @param  array          $values valores para condiciones
  * @return int            numero de registros actualizados
  */
 public static function updateAll(array $fields, $where = null, array $values = array())
 {
     if ($values !== null && !is_array($values)) {
         $values = \array_slice(\func_get_args(), 2);
     }
     $sql = QueryGenerator::updateAll(\get_called_class(), $fields, $values, $where);
     $sth = self::prepare($sql);
     $sth->execute($values);
     return $sth->rowCount();
 }