for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* This file is part of Aura for PHP.
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
namespace Aura\SqlQuery\Common;
use Aura\SqlQuery\AbstractDmlQuery;
* An object for DELETE queries.
* @package Aura.SqlQuery
class Delete extends AbstractDmlQuery implements DeleteInterface
{
use WhereTrait;
* The table to delete from.
* @var string
protected $from;
* Sets the table to delete from.
* @param string $table The table to delete from.
* @return $this
public function from($table)
$this->from = $this->quoter->quoteName($table);
return $this;
}
* Builds this query object into a string.
* @return string
protected function build()
return 'DELETE'
. $this->builder->buildFlags($this->flags)
builder
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
. $this->builder->buildFrom($this->from)
. $this->builder->buildWhere($this->where)
. $this->builder->buildOrderBy($this->order_by);
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: