1 | <?php |
||
12 | class View_Collection extends Collection { |
||
13 | |||
14 | /** |
||
15 | * @inheritDoc |
||
16 | * @return View[] |
||
17 | */ |
||
18 | 24 | public function all() { |
|
21 | |||
22 | /** |
||
23 | * Add a \GV\View to this collection. |
||
24 | * |
||
25 | * @param \GV\View $view The view to add to the internal array. |
||
26 | * |
||
27 | * @api |
||
28 | * @since 2.0 |
||
29 | * @return void |
||
30 | */ |
||
31 | 66 | public function add( $view ) { |
|
40 | |||
41 | /** |
||
42 | * Get a \GV\View from this list. |
||
43 | * |
||
44 | * @param int $view_id The ID of the view to get. |
||
45 | * |
||
46 | * @api |
||
47 | * @since 2.0 |
||
48 | * |
||
49 | * @return \GV\View|null The \GV\View with the $view_id as the ID, or null if not found. |
||
50 | */ |
||
51 | 25 | public function get( $view_id ) { |
|
59 | |||
60 | /** |
||
61 | * Check whether \GV\View with an ID is already here. |
||
62 | * |
||
63 | * @param int $view_id The ID of the view to check. |
||
64 | * |
||
65 | * @api |
||
66 | * @since 2.0 |
||
67 | * |
||
68 | * @return boolean Whether it exists or not. |
||
69 | */ |
||
70 | 25 | public function contains( $view_id ) { |
|
73 | |||
74 | /** |
||
75 | * Get a list of \GV\View objects inside the supplied \WP_Post. |
||
76 | * |
||
77 | * The post can be a gravityview post, which is the simplest case. |
||
78 | * The post can contain gravityview shortcodes as well. |
||
79 | * The post meta can contain gravityview shortcodes. |
||
80 | * |
||
81 | * @param \WP_Post $post The \WP_Post object to look into. |
||
82 | * |
||
83 | * @api |
||
84 | * @since 2.0 |
||
85 | * @return \GV\View_Collection A \GV\View_Collection instance containing the views inside the supplied \WP_Post. |
||
86 | */ |
||
87 | 29 | public static function from_post( \WP_Post $post ) { |
|
132 | |||
133 | /** |
||
134 | * Process meta values when stored singular (string) or multiple (array). Supports nested arrays and JSON strings. |
||
135 | * |
||
136 | * @since 2.1 |
||
137 | * |
||
138 | * @param \GV\View_Collection $views Existing View Collection to merge with |
||
139 | * @param string|array $meta_value Value to parse. Normally the value of $post->{$meta_key}. |
||
140 | * |
||
141 | * @return \GV\View_Collection $views View Collection containing any additional Views found |
||
142 | */ |
||
143 | private static function merge_deep( $views, $meta_value ) { |
||
159 | |||
160 | /** |
||
161 | * Get a list of detected \GV\View objects inside the supplied content. |
||
162 | * |
||
163 | * The content can have a shortcode, this is the simplest case. |
||
164 | * |
||
165 | * @param string $content The content to look into. |
||
166 | * |
||
167 | * @api |
||
168 | * @since 2.0 |
||
169 | * @return \GV\View_Collection A \GV\View_Collection instance containing the views inside the supplied \WP_Post. |
||
170 | */ |
||
171 | 3 | public static function from_content( $content ) { |
|
193 | } |
||
194 |
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.