Cake\Database\Query::update PHP Метод

update() публичный Метод

Can be combined with set() and where() methods to create update queries.
public update ( string $table )
$table string The table you want to update.
    public function update($table)
    {
        $this->_dirty();
        $this->_type = 'update';
        $this->_parts['update'][0] = $table;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Test that epilog() will actually append a string to an update query
  *
  * @return void
  */
 public function testAppendUpdate()
 {
     $query = new Query($this->connection);
     $sql = $query->update('articles')->set(['title' => 'foo'])->where(['id' => 1])->epilog('RETURNING id')->sql();
     $this->assertContains('UPDATE', $sql);
     $this->assertContains('SET', $sql);
     $this->assertContains('WHERE', $sql);
     $this->assertEquals(' RETURNING id', substr($sql, -13));
 }
All Usage Examples Of Cake\Database\Query::update