Ejemplo n.º 1
0
 /**
  * Update a record in the database.
  *
  * @param  array $values
  * @return int
  */
 public function update(array $values)
 {
     // migrate the collection, if needed
     Schema\Builder::getInstance()->dynamic($this->query->getModel(), $values);
     $allowed = $this->fireEvent('updating_multiple', array($this, $values));
     if ($allowed === false) {
         return false;
     } elseif (is_array($allowed)) {
         $values = $allowed;
     }
     $result = $this->query->update($values);
     $this->fireEvent('updated_multiple', array($this, $values));
     return $result;
 }