\Addressable
Adds simple address fields to an object, as well as fields to manage them.
This extensions also integrates with the extension to
save co-ordinates on object write.
Synopsis
class Addressable
extends DataExtension
{
- // members
- protected static $allowed_states;
- protected static $allowed_countries;
- protected static string $postcode_regex = '/^[0-9]+$/';
- protected $allowedStates;
- protected $allowedCountries;
- protected $postcodeRegex;
- private static array $db = ;
- // methods
- public static void set_allowed_states()
- public static void set_allowed_countries()
- public array getAllowedStates()
- public array getAllowedCountries()
- public static void set_postcode_regex()
- public void __construct()
- public void updateCMSFields()
- public void updateFrontEndFields()
- public void populateDefaults()
- public array getAddressFields()
- public bool hasAddress()
- public string getFullAddress()
- public string getFullAddressHTML()
- public string AddressMap()
- public string getCountryName()
- public bool isAddressChanged()
- public void setAllowedStates()
- public void setAllowedCountries()
- public void setPostcodeRegex()
Hierarchy
Extends
- DataExtension
Members
private
- $db
protected
- $allowedCountries
- $allowedStates
- $allowed_countries
- $allowed_states
- $postcodeRegex
- $postcode_regex
Methods
public
- __construct()
- AddressMap() — Returns a static google map of the address, linking out to the address.
- getAddressFields()
- getAllowedCountries() — get the allowed countries for this object
- getAllowedStates() — get the allowed states for this object
- getCountryName() — Returns the country name (not the 2 character code).
- getFullAddress() — Returns the full address as a simple string.
- getFullAddressHTML() — Returns the full address in a simple HTML template.
- hasAddress()
- isAddressChanged() — Returns TRUE if any of the address fields have changed.
- populateDefaults()
- setAllowedCountries() — Sets the countries that a user can select. There are three possible values:
- setAllowedStates() — Sets the states that a user can select. By default they can input any state into a text field, but if you set an array it will be replaced with a dropdown field.
- setPostcodeRegex() — Sets a regex that an entered postcode must match to be accepted. This can be set to NULL to disable postcode validation and allow any value.
- set_allowed_countries() — Sets the default allowed countries for new instances.
- set_allowed_states() — Sets the default allowed states for new instances.
- set_postcode_regex() — Sets the default postcode regex for new instances.
- updateCMSFields()
- updateFrontEndFields()