Exemplo n.º 1
0
 /**
  * Edit record
  *
  * @param array $values
  * @return int
  */
 public function edit(array $values)
 {
     list($sql, $values) = $this->compiler->update($this->name, $values, $this->where);
     // prepare statement & execute
     if ($statement = $this->pdo->prepare($sql) and $result = $statement->execute($values)) {
         return $statement->rowCount();
     }
     // error
     $error = $this->pdo->errorInfo();
     throw new \PDOException('[' . $error[0] . '] ' . $error[2], $error[0]);
 }