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
<?php
namespace Khansia\Db\Sql;
class Recycle implements \Zend\Db\Sql\SqlInterface {
const FLAG_USED = 0;
const FLAG_UNUSED = 1;
const FLAG_DEFAULT = 'unused';
protected $_table = null;
protected $_primary = null;
protected $_set = null;
protected $_exclude = array();
protected $_flag = self::FLAG_DEFAULT;
protected $_where = null;
public function table($table) {
$this->_table = $table;
return $this;
}
public function primary($primary) {
$this->_primary = $primary;
return $this;
}
public function set(\Khansia\Generic\Set $set) {
$this->_set = $set;
return $this;
}
public function exclude($exclude = array()) {
$this->_exclude = $exclude;
return $this;
}
public function flag($flag) {
$this->_flag = $flag;
return $this;
}
public function where($where) {
$this->_where = $where;
return $this;
}
public function getSqlString(\Zend\Db\Adapter\Platform\PlatformInterface $adapterPlatform = null) {
$data = new \stdClass();
$data->table = $this->_table;
$data->primary = $this->_primary;
$data->set = $this->_set;
$data->exclude = $this->_exclude;
$data->flag = $this->_flag;
$data->where = $this->_where;
return $data;
}
}