/** * _regular_formatting * adds formatting to an address * * @access private * @param object EEI_Address_Formatter $formatter * @param object EEI_Address $obj_with_address * @param bool $add_wrapper * @return string */ private static function _regular_formatting(EEI_Address_Formatter $formatter, EEI_Address $obj_with_address, $add_wrapper = true) { $formatted_address = $add_wrapper ? '<div>' : ''; $formatted_address .= $formatter->format($obj_with_address->address(), $obj_with_address->address2(), $obj_with_address->city(), $obj_with_address->state_name(), $obj_with_address->zip(), $obj_with_address->country_name(), $obj_with_address->country_ID()); $formatted_address .= $add_wrapper ? '</div>' : ''; // return the formatted address return $formatted_address; }
/** * addressCountry * The country. For example, USA. You can also provide the two-letter ISO 3166-1 alpha-2 country code. * * @access public * @param EEI_Address $obj_with_address * @return string */ public static function addressCountry(EEI_Address $obj_with_address = null) { $country = $obj_with_address->country_name(); if (!empty($country)) { return '<span itemprop="addressCountry">' . $country . '</span>'; } else { return ''; } }