1 | <?php |
||
11 | class EEH_Schema |
||
12 | { |
||
13 | |||
14 | |||
15 | /** |
||
16 | * generates JSON-based linked data for an event |
||
17 | * |
||
18 | * @param EE_Event $event |
||
19 | * @throws EE_Error |
||
20 | */ |
||
21 | public static function add_json_linked_data_for_event(EE_Event $event) |
||
83 | |||
84 | |||
85 | /** |
||
86 | * location |
||
87 | * The location of the event, organization or action. |
||
88 | * Should include the Venue name AND schema formatted address info |
||
89 | * |
||
90 | * @access public |
||
91 | * @param string $location |
||
92 | * @return string |
||
93 | */ |
||
94 | public static function location($location = null) |
||
100 | |||
101 | |||
102 | |||
103 | /** |
||
104 | * name |
||
105 | * The name of the Event or Venue. |
||
106 | * |
||
107 | * @access public |
||
108 | * @param string $name |
||
109 | * @return string |
||
110 | */ |
||
111 | public static function name($name = null) |
||
115 | |||
116 | |||
117 | |||
118 | /** |
||
119 | * streetAddress |
||
120 | * The street address. For example, 1600 Amphitheatre Pkwy. |
||
121 | * |
||
122 | * @access public |
||
123 | * @param EEI_Address $obj_with_address |
||
124 | * @return string |
||
125 | */ |
||
126 | public static function streetAddress(EEI_Address $obj_with_address = null) |
||
131 | |||
132 | |||
133 | |||
134 | /** |
||
135 | * postOfficeBoxNumber |
||
136 | * The post office box number for PO box addresses. |
||
137 | * |
||
138 | * @access public |
||
139 | * @param EEI_Address $obj_with_address |
||
140 | * @return string |
||
141 | */ |
||
142 | public static function postOfficeBoxNumber(EEI_Address $obj_with_address = null) |
||
155 | |||
156 | |||
157 | |||
158 | /** |
||
159 | * addressLocality |
||
160 | * The locality (city, town, etc). For example, Mountain View. |
||
161 | * |
||
162 | * @access public |
||
163 | * @param EEI_Address $obj_with_address |
||
164 | * @return string |
||
165 | */ |
||
166 | public static function addressLocality(EEI_Address $obj_with_address = null) |
||
171 | |||
172 | |||
173 | |||
174 | /** |
||
175 | * addressRegion |
||
176 | * The region (state, province, etc). For example, CA. |
||
177 | * |
||
178 | * @access public |
||
179 | * @param EEI_Address $obj_with_address |
||
180 | * @return string |
||
181 | */ |
||
182 | public static function addressRegion(EEI_Address $obj_with_address = null) |
||
191 | |||
192 | |||
193 | |||
194 | /** |
||
195 | * addressCountry |
||
196 | * The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code. |
||
197 | * |
||
198 | * @access public |
||
199 | * @param EEI_Address $obj_with_address |
||
200 | * @return string |
||
201 | */ |
||
202 | public static function addressCountry(EEI_Address $obj_with_address = null) |
||
211 | |||
212 | |||
213 | |||
214 | /** |
||
215 | * postalCode |
||
216 | * The postal code. For example, 94043. |
||
217 | * |
||
218 | * @access public |
||
219 | * @param EEI_Address $obj_with_address |
||
220 | * @return string |
||
221 | */ |
||
222 | public static function postalCode(EEI_Address $obj_with_address = null) |
||
228 | |||
229 | |||
230 | |||
231 | /** |
||
232 | * telephone |
||
233 | * The telephone number. |
||
234 | * |
||
235 | * @access public |
||
236 | * @param string $phone_nmbr |
||
237 | * @return string |
||
238 | */ |
||
239 | public static function telephone($phone_nmbr = null) |
||
244 | |||
245 | |||
246 | |||
247 | /** |
||
248 | * URL |
||
249 | * URL of the item as a clickable link |
||
250 | * |
||
251 | * @access public |
||
252 | * @param string $url - the URL that the link will resolve to |
||
253 | * @param string $text - the text that will be used for the visible link |
||
254 | * @param array $attributes - array of additional link attributes in attribute_name => value pairs. ie: array( 'title' => 'click here', 'class' => 'link-class' ) |
||
255 | * @return string (link) |
||
256 | */ |
||
257 | public static function url($url = null, $text = null, $attributes = array()) |
||
273 | } |
||
274 |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: