1 | <?php |
||
11 | class EntryQuery extends ApiObject |
||
12 | { |
||
13 | private $filters; |
||
14 | private $booleanAnd; |
||
15 | private $ascending; |
||
16 | private $sortField; |
||
17 | private $pageStart; |
||
18 | private $pageSize; |
||
19 | private $system; |
||
20 | |||
21 | /** |
||
22 | * @api |
||
23 | * |
||
24 | * @since 0.1.0 |
||
25 | */ |
||
26 | public function __construct() |
||
31 | |||
32 | public function __toString() |
||
66 | |||
67 | /** |
||
68 | * Filter the results based on entry filters. |
||
69 | * |
||
70 | * @api |
||
71 | * |
||
72 | * @param EntryFilter|EntryFilter[] $filters |
||
73 | * @param bool $booleanAnd |
||
74 | * |
||
75 | * @since 0.1.0 |
||
76 | * |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function where($filters, $booleanAnd = true) |
||
96 | |||
97 | /** |
||
98 | * When paginating results of a query, set the offset. |
||
99 | * |
||
100 | * **Warning:** This function should _not_ be used in conjunction with EntryQuery::paginate(). |
||
101 | * |
||
102 | * @api |
||
103 | * |
||
104 | * @param int $offset |
||
105 | * |
||
106 | * @throws \InvalidArgumentException if $offset is not an integer |
||
107 | * |
||
108 | * @since 0.1.0 |
||
109 | * |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function offset($offset) |
||
123 | |||
124 | /** |
||
125 | * Set the number of results to be returned in a query. |
||
126 | * |
||
127 | * **Warnings** |
||
128 | * |
||
129 | * - The API restricts this value to a maximum of 100. However, this function will not impose any restrictions should |
||
130 | * the API change this restriction |
||
131 | * - This function should _not_ bt used in conjunction with EntryQuery::paginate() |
||
132 | * |
||
133 | * @api |
||
134 | * |
||
135 | * @param int $limit |
||
136 | * |
||
137 | * @throws \InvalidArgumentException if $limit is not an integer |
||
138 | * |
||
139 | * @since 0.1.0 |
||
140 | * |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function limit($limit) |
||
154 | |||
155 | /** |
||
156 | * Define the pagination for this query. |
||
157 | * |
||
158 | * **Warning:** This function is provided as a convenience function that will set both the offset and limit in one |
||
159 | * function call. This should be instead of calling EntryQuery::offset() and EntryQuery::limit() separately. |
||
160 | * |
||
161 | * @api |
||
162 | * |
||
163 | * @param int $offset |
||
164 | * @param int $limit |
||
165 | * |
||
166 | * @throws \InvalidArgumentException if $offset or $limit are not integers |
||
167 | * |
||
168 | * @since 0.1.0 |
||
169 | * |
||
170 | * @return $this |
||
171 | */ |
||
172 | public function paginate($offset, $limit) |
||
179 | |||
180 | /** |
||
181 | * Sort the results based on a field. |
||
182 | * |
||
183 | * @api |
||
184 | * |
||
185 | * @param string $field The API Field ID to sort by |
||
186 | * @param bool $ascending Set to true to sort in ascending order |
||
187 | * |
||
188 | * @since 0.1.0 |
||
189 | * |
||
190 | * @return $this |
||
191 | */ |
||
192 | public function sortBy($field, $ascending = true) |
||
199 | |||
200 | /** |
||
201 | * Whether or not to receive system fields for the entries. |
||
202 | * |
||
203 | * @api |
||
204 | * |
||
205 | * @param bool $system |
||
206 | * |
||
207 | * @since 0.1.0 |
||
208 | * |
||
209 | * @return $this |
||
210 | */ |
||
211 | public function getSystemFields($system = true) |
||
222 | |||
223 | /** |
||
224 | * Convenience function to create an EntryQuery that be used for immediate chaining. |
||
225 | * |
||
226 | * @return EntryQuery |
||
227 | */ |
||
228 | public static function create() |
||
234 | } |
||
235 |