This changes the query type to be 'insert'.
Note calling this method will reset any data previously set
with Query::values()
Can be combined with the where() method to create delete queries.
/** * cache() should fail on non select queries. * * @expectedException \RuntimeException * @return void */ public function testCacheErrorOnNonSelect() { $table = TableRegistry::get('articles', ['table' => 'articles']); $query = new Query($this->connection, $table); $query->insert(['test']); $query->cache('my_key'); }