1 | <?php |
||
10 | class Query |
||
11 | { |
||
12 | /** |
||
13 | * |
||
14 | */ |
||
15 | const TYPE_QUERY = 'QUERY'; |
||
16 | /** |
||
17 | * |
||
18 | */ |
||
19 | const TYPE_SELECT = 'SELECT'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | public $table; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $attributes = array( |
||
30 | 'where' => array(), |
||
31 | 'columns' => array() |
||
32 | ); |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $type = "SELECT"; |
||
38 | |||
39 | /** |
||
40 | * @param null $table |
||
41 | */ |
||
42 | public function __construct($table = null) |
||
46 | |||
47 | /** |
||
48 | * @param $queryStr |
||
49 | * @return Query |
||
50 | */ |
||
51 | public static function sql($queryStr, $params = null) |
||
61 | |||
62 | /** |
||
63 | * @param $table |
||
64 | * @return Query |
||
65 | */ |
||
66 | public static function table($table) |
||
70 | |||
71 | /** |
||
72 | * @param $columns |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function select($columns = null) |
||
81 | |||
82 | /** |
||
83 | * @param $query |
||
84 | * @param string $type |
||
85 | * @return Query |
||
86 | */ |
||
87 | public function whereQ(Query $query, $type = "AND") |
||
94 | |||
95 | /** |
||
96 | * @param $column |
||
97 | * @param $value |
||
98 | * @param string $operator |
||
99 | * @param string $type |
||
100 | * @return Query |
||
101 | */ |
||
102 | public function where($column, $value, $operator = "=", $type = "AND") |
||
107 | |||
108 | /** |
||
109 | * @param $column |
||
110 | * @param $value |
||
111 | * @param string $operator |
||
112 | * @return Query |
||
113 | */ |
||
114 | public function andWhere($column, $value, $operator = "=") |
||
118 | |||
119 | /** |
||
120 | * @param $column |
||
121 | * @param $value |
||
122 | * @param string $operator |
||
123 | * @return Query |
||
124 | */ |
||
125 | public function orWhere($column, $value, $operator = "=") |
||
129 | |||
130 | /** |
||
131 | * @param Grammar $grammar |
||
132 | * @return array |
||
133 | */ |
||
134 | public function build(Grammar $grammar) |
||
143 | |||
144 | /** |
||
145 | * @param $name |
||
146 | * @return array |
||
147 | */ |
||
148 | public function __get($name) |
||
152 | |||
153 | /** |
||
154 | * @param $name |
||
155 | * @param $value |
||
156 | */ |
||
157 | public function __set($name, $value) |
||
161 | |||
162 | /** |
||
163 | * @return string |
||
164 | */ |
||
165 | public function getType() |
||
169 | |||
170 | /** |
||
171 | * @param string $type |
||
172 | */ |
||
173 | public function setType($type) |
||
177 | } |
||
178 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.