1 | <?php |
||
12 | class QueryBuilder extends BaseBuilder |
||
13 | { |
||
14 | /** |
||
15 | * Query arguments |
||
16 | * @var Collection |
||
17 | */ |
||
18 | protected $query; |
||
19 | |||
20 | /** |
||
21 | * Taxonomy Identifier |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $taxonomy; |
||
25 | |||
26 | /** |
||
27 | * QueryBuilder Constructor. |
||
28 | * |
||
29 | * @param array $args |
||
30 | */ |
||
31 | public function __construct(array $args = []) |
||
35 | |||
36 | /** |
||
37 | * Create a new instance. |
||
38 | * |
||
39 | * @return static |
||
40 | */ |
||
41 | public static function make() |
||
45 | |||
46 | /** |
||
47 | * Restrict the query to terms of the provided Taxonomy. |
||
48 | * |
||
49 | * @param string $taxonomy |
||
50 | * |
||
51 | * @return $this |
||
52 | */ |
||
53 | public function forTaxonomy($taxonomy) |
||
59 | |||
60 | /** |
||
61 | * Get all terms. |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function all() |
||
70 | |||
71 | /** |
||
72 | * Include terms that have no related objects in the results. |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function includeEmpty() |
||
80 | |||
81 | /** |
||
82 | * Limit the maximum number of results returned. |
||
83 | * |
||
84 | * @param int $max_results Maximum number to return. 0 or 'all' for unlimited. |
||
85 | * |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function limit($max_results) |
||
92 | |||
93 | /** |
||
94 | * Execute the query and return the raw results. |
||
95 | * |
||
96 | * @throws WP_ErrorException |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | protected function query() |
||
115 | |||
116 | /** |
||
117 | * Set an arbitrary query parameter. |
||
118 | * |
||
119 | * @param $parameter |
||
120 | * @param $value |
||
121 | * |
||
122 | * @return $this |
||
123 | */ |
||
124 | public function set($parameter, $value) |
||
130 | } |
||
131 |