-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDelete.php
More file actions
119 lines (99 loc) · 1.95 KB
/
Delete.php
File metadata and controls
119 lines (99 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
namespace Harp\Query;
use Harp\Query\Compiler;
use Harp\Query\SQL;
/**
* @author Ivan Kerin <ikerin@gmail.com>
* @copyright (c) 2014 Clippings Ltd.
* @license http://spdx.org/licenses/BSD-3-Clause
*/
class Delete extends AbstractWhere
{
/**
* @var SQL\Aliased[]|null
*/
protected $table;
/**
* @var SQL\Aliased[]|null
*/
protected $from;
/**
* @return SQL\Aliased[]|null
*/
public function getTable()
{
return $this->table;
}
/**
* @param SQL\Aliased[] $table
*/
public function setTable(array $table)
{
$this->table = $table;
return $this;
}
/**
* @return Delete $this
*/
public function clearTable()
{
$this->table = null;
return $this;
}
/**
* @return SQL\Aliased[]|null
*/
public function getFrom()
{
return $this->from;
}
/**
* @param SQL\Aliased[] $from
*/
public function setFrom(array $from)
{
$this->from = $from;
return $this;
}
/**
* @return Delete $this
*/
public function clearFrom()
{
$this->from = null;
return $this;
}
/**
* @param string|SQL\SQL $table
* @return Delete $this
*/
public function table($table)
{
$this->table []= new SQL\Aliased($table);
return $this;
}
/**
* @param string|SQL\SQL $table
* @param string $alias
* @return Delete $this
*/
public function from($table, $alias = null)
{
$this->from []= new SQL\Aliased($table, $alias);
return $this;
}
/**
* @return string
*/
public function sql()
{
return Compiler\Delete::render($this);
}
/**
* @return array
*/
public function getParameters()
{
return Compiler\Delete::parameters($this);
}
}