Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00015 final class DeleteQuery extends QuerySkeleton implements SQLTableName
00016 {
00017 protected $table = null;
00018
00019 public function getId()
00020 {
00021 throw new UnsupportedMethodException();
00022 }
00023
00027 public function from($table)
00028 {
00029 $this->table = $table;
00030
00031 return $this;
00032 }
00033
00034 public function getTable()
00035 {
00036 return $this->table;
00037 }
00038
00039 public function toDialectString(Dialect $dialect)
00040 {
00041 if ($this->where) {
00042 $deleteStr =
00043 'DELETE FROM '.$dialect->quoteTable($this->table)
00044 .parent::toDialectString($dialect);
00045
00046 $this->checkReturning($dialect);
00047
00048 if (empty($this->returning)) {
00049 return $deleteStr;
00050 } else {
00051 $query =
00052 $deleteStr
00053 .' RETURNING '
00054 .$this->toDialectStringReturning($dialect);
00055
00056 return $query;
00057 }
00058 } else
00059 throw new WrongArgumentException(
00060 "leave '{$this->table}' table alone in peace, bastard"
00061 );
00062 }
00063 }
00064 ?>