@@ -9,154 +9,277 @@ class Query extends \PHPixie\ORM\Conditions\Builder\Proxy
99 * @type \PHPixie\ORM\Drivers\Driver\PDO\Query|\PHPixie\ORM\Drivers\Driver\Mongo\Query
1010 */
1111 protected $ query ;
12-
12+
13+ /**
14+ * Query constructor.
15+ *
16+ * @param $query
17+ */
1318 public function __construct ($ query )
1419 {
1520 parent ::__construct ($ query );
1621 $ this ->query = $ query ;
1722 }
18-
23+
24+ /**
25+ * @return string
26+ */
1927 public function modelName ()
2028 {
2129 return $ this ->query ->modelName ();
2230 }
23-
31+
32+ /**
33+ * @param $limit
34+ *
35+ * @return $this
36+ * @throws \PHPixie\ORM\Exception\Query
37+ */
2438 public function limit ($ limit )
2539 {
2640 $ this ->query ->limit ($ limit );
2741 return $ this ;
2842 }
29-
43+
44+ /**
45+ * @return static
46+ */
3047 public function getLimit ()
3148 {
3249 return $ this ->query ->getLimit ();
3350 }
34-
51+
52+ /**
53+ * @return $this
54+ */
3555 public function clearLimit ()
3656 {
3757 $ this ->query ->clearLimit ();
3858 return $ this ;
3959 }
40-
41-
60+
61+
62+ /**
63+ * @param $offset
64+ *
65+ * @return $this
66+ * @throws \PHPixie\ORM\Exception\Query
67+ */
4268 public function offset ($ offset )
4369 {
4470 $ this ->query ->offset ($ offset );
4571 return $ this ;
4672 }
47-
73+
74+ /**
75+ * @return static
76+ */
4877 public function getOffset ()
4978 {
5079 return $ this ->query ->getOffset ();
5180 }
52-
81+
82+ /**
83+ * @return $this
84+ */
5385 public function clearOffset ()
5486 {
5587 $ this ->query ->clearOffset ();
5688 return $ this ;
5789 }
5890
91+ /**
92+ * @param $field
93+ * @param $direction
94+ *
95+ * @return $this
96+ */
5997 public function orderBy ($ field , $ direction )
6098 {
6199 $ this ->query ->orderBy ($ field , $ direction );
62100 return $ this ;
63101 }
64102
103+ /**
104+ * @param $field
105+ *
106+ * @return $this
107+ */
65108 public function orderAscendingBy ($ field )
66109 {
67110 $ this ->query ->orderAscendingBy ($ field );
68111 return $ this ;
69112 }
70-
113+
114+ /**
115+ * @param $field
116+ *
117+ * @return $this
118+ */
71119 public function orderDescendingBy ($ field )
72120 {
73121 $ this ->query ->orderDescendingBy ($ field );
74122 return $ this ;
75123 }
76-
124+
125+ /**
126+ * @return array|static
127+ */
77128 public function getOrderBy ()
78129 {
79130 return $ this ->query ->getOrderBy ();
80131 }
81-
132+
133+ /**
134+ * @return $this
135+ */
82136 public function clearOrderBy ()
83137 {
84138 $ this ->query ->clearOrderBy ();
85139 return $ this ;
86140 }
87-
141+
142+ /**
143+ * @return array
144+ */
88145 public function getConditions ()
89146 {
90147 return $ this ->query ->getConditions ();
91148 }
92-
149+
150+ /**
151+ * @param array $preload
152+ * @param null $fields
153+ *
154+ * @return \PHPixie\ORM\Plans\Plan
155+ */
93156 public function planFind ($ preload = array (), $ fields = null )
94157 {
95158 return $ this ->query ->planFind ($ preload , $ fields );
96159 }
97-
160+
161+ /**
162+ * @param array $preload
163+ * @param null $fields
164+ *
165+ * @return \PHPixie\ORM\Loaders\Loader|void
166+ */
98167 public function find ($ preload = array (), $ fields = null )
99168 {
100169 return $ this ->query ->find ($ preload , $ fields );
101170 }
102-
171+
172+ /**
173+ * @param array $preload
174+ * @param null $fields
175+ *
176+ * @return null|\PHPixie\ORM\Models\Type\Database\Implementation\Entity
177+ * @throws \PHPixie\ORM\Exception\Query
178+ */
103179 public function findOne ($ preload = array (), $ fields = null )
104180 {
105181 return $ this ->query ->findOne ($ preload , $ fields );
106182 }
107-
183+
184+ /**
185+ * @return \PHPixie\ORM\Plans\Plan
186+ */
108187 public function planDelete ()
109188 {
110189 return $ this ->query ->planDelete ();
111190 }
112-
191+
192+ /**
193+ * @return $this
194+ */
113195 public function delete ()
114196 {
115197 $ this ->query ->delete ();
116198 return $ this ;
117199 }
118-
200+
201+ /**
202+ * @param $data
203+ *
204+ * @return \PHPixie\ORM\Plans\Plan
205+ */
119206 public function planUpdate ($ data )
120207 {
121208 return $ this ->query ->planUpdate ($ data );
122209 }
123-
210+
211+ /**
212+ * @param $data
213+ *
214+ * @return $this
215+ */
124216 public function update ($ data )
125217 {
126218 $ this ->query ->update ($ data );
127219 return $ this ;
128220 }
129-
221+
222+ /**
223+ * @param $update
224+ *
225+ * @return \PHPixie\ORM\Plans\Plan
226+ */
130227 public function planUpdateValue ($ update )
131228 {
132229 return $ this ->query ->planUpdateValue ($ update );
133230 }
134-
231+
232+ /**
233+ * @return \PHPixie\ORM\Values\Update\Builder
234+ */
135235 public function getUpdateBuilder ()
136236 {
137237 return $ this ->query ->getUpdateBuilder ();
138238 }
139-
239+
240+ /**
241+ * @return \PHPixie\ORM\Plans\Plan
242+ */
140243 public function planCount ()
141244 {
142245 return $ this ->query ->planCount ();
143246 }
144-
247+
248+ /**
249+ * @return int|void
250+ */
145251 public function count ()
146252 {
147253 return $ this ->query ->count ();
148254 }
149-
255+
256+ /**
257+ * @param $name
258+ *
259+ * @return \PHPixie\ORM\Relationships\Relationship\Property
260+ * @throws \PHPixie\ORM\Exception\Relationship
261+ */
150262 public function getRelationshipProperty ($ name )
151263 {
152264 return $ this ->query ->getRelationshipProperty ($ name );
153265 }
154-
266+
267+ /**
268+ * @param $name
269+ *
270+ * @return \PHPixie\ORM\Relationships\Relationship\Property
271+ */
155272 public function __get ($ name )
156273 {
157274 return $ this ->query ->__get ($ name );
158275 }
159-
276+
277+ /**
278+ * @param $method
279+ * @param $params
280+ *
281+ * @return mixed
282+ */
160283 public function __call ($ method , $ params )
161284 {
162285 return $ this ->query ->__call ($ method , $ params );
0 commit comments