1 | <?php |
||
8 | class QueryBuilder extends BaseBuilder |
||
9 | { |
||
10 | /** |
||
11 | * WP_Query instance |
||
12 | * |
||
13 | * @var WP_Query |
||
14 | */ |
||
15 | protected $query; |
||
16 | |||
17 | /** |
||
18 | * Builder constructor. |
||
19 | * |
||
20 | * @param WP_Query $query |
||
21 | */ |
||
22 | public function __construct(WP_Query $query = null) |
||
30 | |||
31 | /** |
||
32 | * Create a new instance. |
||
33 | * |
||
34 | * @param WP_Query $query |
||
35 | * |
||
36 | * @return static |
||
37 | */ |
||
38 | public static function make(WP_Query $query = null) |
||
42 | |||
43 | /** |
||
44 | * Limit the number of returned results |
||
45 | * |
||
46 | * @param integer $limit The maximum number of results to return |
||
47 | * use -1 for no limit |
||
48 | * |
||
49 | * @return $this |
||
50 | */ |
||
51 | public function limit($limit) |
||
55 | |||
56 | /** |
||
57 | * Return an unlimited number of results. |
||
58 | * |
||
59 | * @return $this |
||
60 | */ |
||
61 | public function all() |
||
65 | |||
66 | /** |
||
67 | * Set the order for the query |
||
68 | * |
||
69 | * @param string $order |
||
70 | * |
||
71 | * @return $this |
||
72 | */ |
||
73 | public function order($order) |
||
77 | |||
78 | /** |
||
79 | * Query by post status |
||
80 | * |
||
81 | * @param string|array $status the post status or stati to match |
||
82 | * |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function whereStatus($status) |
||
89 | |||
90 | /** |
||
91 | * Query by slug |
||
92 | * |
||
93 | * @param string $slug the post slug to query by |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function whereSlug($slug) |
||
101 | |||
102 | /** |
||
103 | * Set a query variable on the query |
||
104 | * |
||
105 | * @param string $var Query variable key |
||
106 | * @param mixed $value Query value for key |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function set($var, $value) |
||
116 | |||
117 | /** |
||
118 | * Execute the query and return the raw results. |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | protected function query() |
||
131 | } |
||
132 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read 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.