1 | <?php |
||
12 | class Field_Collection extends Collection { |
||
13 | |||
14 | /** |
||
15 | * Returns all the objects in this collection as an an array. Here for docBlock purposes only. |
||
16 | * |
||
17 | * @since 2.0.13.1 |
||
18 | * |
||
19 | * @return \GV\Field[] |
||
20 | */ |
||
21 | 111 | public function all() { |
|
24 | |||
25 | /** |
||
26 | * Add a \GV\Field to this collection. |
||
27 | * |
||
28 | * @param \GV\Field $field The field to add to the internal array. |
||
29 | * |
||
30 | * @api |
||
31 | * @since 2.0 |
||
32 | * @return void |
||
33 | */ |
||
34 | 183 | public function add( $field ) { |
|
41 | |||
42 | /** |
||
43 | * Get a \GV\Field from this list by UID. |
||
44 | * |
||
45 | * @param int $field_uid The UID of the field in the field to get. |
||
46 | * |
||
47 | * @api |
||
48 | * @since 2.0 |
||
49 | * |
||
50 | * @return \GV\Field|null The \GV\Field with the $field_uid as the UID, or null if not found. |
||
51 | */ |
||
52 | 2 | public function get( $field_uid ) { |
|
60 | |||
61 | /** |
||
62 | * Get a copy of this \GV\Field_Collection filtered by type. |
||
63 | * |
||
64 | * @param string $type The type of the field to get. |
||
65 | * |
||
66 | * @api |
||
67 | * @since develop |
||
68 | * |
||
69 | * @return \GV\Field_Collection A filtered collection of \GV\Fields, filtered by type. |
||
70 | */ |
||
71 | 75 | public function by_type( $type ) { |
|
83 | |||
84 | /** |
||
85 | * Get a copy of this \GV\Field_Collection filtered by position. |
||
86 | * |
||
87 | * @param string $position The position to get the fields for. |
||
88 | * Can be a wildcard * |
||
89 | * |
||
90 | * @api |
||
91 | * @since |
||
92 | * |
||
93 | * @return \GV\Field_Collection A filtered collection of \GV\Fields, filtered by position. |
||
94 | */ |
||
95 | 49 | public function by_position( $position ) { |
|
107 | |||
108 | /** |
||
109 | * Get a copy of this \GV\Field_Collection filtered by visibility to current user context. |
||
110 | * |
||
111 | * @api |
||
112 | * @since |
||
113 | * |
||
114 | * @param $view \GV\View The view! |
||
115 | * |
||
116 | * @return \GV\Field_Collection A filtered collection of \GV\Fields, filtered by visibility. |
||
117 | */ |
||
118 | 75 | public function by_visible( $view = null ) { |
|
129 | |||
130 | /** |
||
131 | * Parse a configuration array into a Field_Collection. |
||
132 | * |
||
133 | * @param array $configuration The configuration, structured like so: |
||
134 | * |
||
135 | * array( |
||
136 | * |
||
137 | * [other zones] |
||
138 | * |
||
139 | * 'directory_list-title' => array( |
||
140 | * |
||
141 | * [other fields] |
||
142 | * |
||
143 | * '5372653f25d44' => array( |
||
144 | * @see \GV\Field::as_configuration() for structure |
||
145 | * ) |
||
146 | * |
||
147 | * [other fields] |
||
148 | * ) |
||
149 | * |
||
150 | * [other zones] |
||
151 | * ) |
||
152 | * |
||
153 | * @return \GV\Field_Collection A collection of fields. |
||
154 | */ |
||
155 | 184 | public static function from_configuration( $configuration ) { |
|
173 | |||
174 | /** |
||
175 | * Return a configuration array for this field collection. |
||
176 | * |
||
177 | * @return array See \GV\Field_Collection::from_configuration() for structure. |
||
178 | */ |
||
179 | 55 | public function as_configuration() { |
|
194 | } |
||
195 |
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.