@@ 195-209 (lines=15) @@ | ||
192 | * @throws InvalidInterfaceException |
|
193 | * @since $VID:$ |
|
194 | */ |
|
195 | public function resolveState($source) |
|
196 | { |
|
197 | switch (true) { |
|
198 | case $source instanceof EE_Attendee: |
|
199 | case $source instanceof EE_Venue: |
|
200 | $state_id = $source->state_ID(); |
|
201 | break; |
|
202 | default: |
|
203 | $state_id = null; |
|
204 | break; |
|
205 | } |
|
206 | return $state_id |
|
207 | ? EEM_State::instance()->get_one_by_ID($state_id) |
|
208 | : null; |
|
209 | } |
|
210 | ||
211 | ||
212 | /** |
|
@@ 221-238 (lines=18) @@ | ||
218 | * @throws InvalidInterfaceException |
|
219 | * @since $VID:$ |
|
220 | */ |
|
221 | public function resolveCountry($source) |
|
222 | { |
|
223 | switch (true) { |
|
224 | case $source instanceof EE_State: |
|
225 | $country_iso = $source->country_iso(); |
|
226 | break; |
|
227 | case $source instanceof EE_Venue: |
|
228 | $country_iso = $source->country_ID(); |
|
229 | break; |
|
230 | default: |
|
231 | $country_iso = null; |
|
232 | break; |
|
233 | } |
|
234 | ||
235 | return $country_iso |
|
236 | ? EEM_Country::instance()->get_one_by_ID($country_iso) |
|
237 | : null; |
|
238 | } |
|
239 | } |