Esempio n. 1
0
 /**
  * Updates an existing record.
  *
  * @access  protected
  * @param   \mako\database\midgard\Query  $query  Query builder
  * @return  boolean
  */
 protected function updateRecord($query)
 {
     $query->where($this->primaryKey, '=', $this->columns[$this->primaryKey]);
     return (bool) $query->update($this->getModified());
 }
Esempio n. 2
0
 /**
  * @expectedException \mako\database\midgard\ReadOnlyRecordException
  */
 public function testUpdateWithException()
 {
     $model = $this->getModel();
     $model->shouldReceive('isReadOnly')->twice()->andReturn(true);
     $model->shouldReceive('getTable')->once()->andReturn('tests');
     $query = new Query($this->getConnecion(), $model);
     $query->update(['foo' => 'bar']);
 }