/** * Test that epilog() will actually append a string to a delete query * * @return void */ public function testAppendDelete() { $query = new Query($this->connection); $sql = $query->delete('articles')->where(['id' => 1])->epilog('RETURNING id')->sql(); $this->assertContains('DELETE FROM', $sql); $this->assertContains('WHERE', $sql); $this->assertEquals(' RETURNING id', substr($sql, -13)); }
/** * Create a delete query. * * This changes the query type to be 'delete'. * Can be combined with the where() method to create delete queries. * * @param string|null $table Unused parameter. * @return $this */ public function delete($table = null) { $repo = $this->repository(); $this->from([$repo->alias() => $repo->table()]); return parent::delete(); }
/** * Create a delete query. * * This changes the query type to be 'delete'. * Can be combined with the where() method to create delete queries. * * @param string $table Unused parameter. * @return Query */ public function delete($table = null) { $table = $this->repository()->table(); return parent::delete($table); }