1 | <?php |
||
17 | class EEH_Schema { |
||
18 | |||
19 | |||
20 | /** |
||
21 | * generates JSON-based linked data for an event |
||
22 | * |
||
23 | * @param \EE_Event $event |
||
24 | */ |
||
25 | public static function add_json_linked_data_for_event(\EE_Event $event) |
||
81 | |||
82 | |||
83 | /** |
||
84 | * location |
||
85 | * The location of the event, organization or action. |
||
86 | * Should include the Venue name AND schema formatted address info |
||
87 | * |
||
88 | * @access public |
||
89 | * @param string $location |
||
90 | * @return string |
||
91 | */ |
||
92 | public static function location( $location = null ) { |
||
97 | |||
98 | |||
99 | |||
100 | /** |
||
101 | * name |
||
102 | * The name of the Event or Venue. |
||
103 | * |
||
104 | * @access public |
||
105 | * @param string $name |
||
106 | * @return string |
||
107 | */ |
||
108 | public static function name( $name = null ) { |
||
111 | |||
112 | |||
113 | |||
114 | /** |
||
115 | * streetAddress |
||
116 | * The street address. For example, 1600 Amphitheatre Pkwy. |
||
117 | * |
||
118 | * @access public |
||
119 | * @param EEI_Address $obj_with_address |
||
120 | * @return string |
||
121 | */ |
||
122 | public static function streetAddress( EEI_Address $obj_with_address = null ) { |
||
126 | |||
127 | |||
128 | |||
129 | /** |
||
130 | * postOfficeBoxNumber |
||
131 | * The post office box number for PO box addresses. |
||
132 | * |
||
133 | * @access public |
||
134 | * @param EEI_Address $obj_with_address |
||
135 | * @return string |
||
136 | */ |
||
137 | public static function postOfficeBoxNumber( EEI_Address $obj_with_address = null ) { |
||
149 | |||
150 | |||
151 | |||
152 | /** |
||
153 | * addressLocality |
||
154 | * The locality (city, town, etc). For example, Mountain View. |
||
155 | * |
||
156 | * @access public |
||
157 | * @param EEI_Address $obj_with_address |
||
158 | * @return string |
||
159 | */ |
||
160 | public static function addressLocality( EEI_Address $obj_with_address = null ) { |
||
164 | |||
165 | |||
166 | |||
167 | /** |
||
168 | * addressRegion |
||
169 | * The region (state, province, etc). For example, CA. |
||
170 | * |
||
171 | * @access public |
||
172 | * @param EEI_Address $obj_with_address |
||
173 | * @return string |
||
174 | */ |
||
175 | public static function addressRegion( EEI_Address $obj_with_address = null ) { |
||
183 | |||
184 | |||
185 | |||
186 | /** |
||
187 | * addressCountry |
||
188 | * The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code. |
||
189 | * |
||
190 | * @access public |
||
191 | * @param EEI_Address $obj_with_address |
||
192 | * @return string |
||
193 | */ |
||
194 | public static function addressCountry( EEI_Address $obj_with_address = null ) { |
||
202 | |||
203 | |||
204 | |||
205 | /** |
||
206 | * postalCode |
||
207 | * The postal code. For example, 94043. |
||
208 | * |
||
209 | * @access public |
||
210 | * @param EEI_Address $obj_with_address |
||
211 | * @return string |
||
212 | */ |
||
213 | public static function postalCode( EEI_Address $obj_with_address = null ) { |
||
218 | |||
219 | |||
220 | |||
221 | /** |
||
222 | * telephone |
||
223 | * The telephone number. |
||
224 | * |
||
225 | * @access public |
||
226 | * @param string $phone_nmbr |
||
227 | * @return string |
||
228 | */ |
||
229 | public static function telephone( $phone_nmbr = null ) { |
||
233 | |||
234 | |||
235 | |||
236 | /** |
||
237 | * URL |
||
238 | * URL of the item as a clickable link |
||
239 | * |
||
240 | * @access public |
||
241 | * @param string $url - the URL that the link will resolve to |
||
242 | * @param string $text - the text that will be used for the visible link |
||
243 | * @param array $attributes - array of additional link attributes in attribute_name => value pairs. ie: array( 'title' => 'click here', 'class' => 'link-class' ) |
||
244 | * @return string (link) |
||
245 | */ |
||
246 | public static function url( $url = null, $text = null, $attributes = array() ) { |
||
261 | |||
262 | |||
263 | |||
264 | } |
||
265 | // End of file EEH_Schema.helper.php |
||
266 | // Location: /EEH_Schema.helper.php |
If a variable is not always an object, we recommend to add an additional type check to ensure your method call is safe: