Doctrine\OrientDB\Query\Query::delete PHP Method

delete() public method

Executes a DELETE SQL query on the given class (= $from).
public delete ( string $from ) : Delete
$from string
return Delete
    public function delete($from)
    {
        $commandClass = $this->getCommandClass('delete');
        $this->command = new $commandClass($from);
        return $this->command;
    }

Usage Example

 /**
  * @depends testInsertRecord
  */
 public function testDeleteRecord()
 {
     $binding = $this->createHttpBinding();
     $before = $this->getResultCount($binding->command('SELECT count(*) FROM Address'));
     $query = new Query();
     $query->delete('Address')->where('street = ?', '5th avenue')->orWhere('type = "villetta"');
     $this->assertHttpStatus(200, $this->doQuery($query, $binding));
     $after = $this->getResultCount($binding->command('SELECT count(*) FROM Address'));
     $this->assertSame($after, $before - 1);
 }