Symbiote\Addressable\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
- private static array $db = ;
- private static array $allowed_states = ;
- private static array $allowed_countries = ;
- private static string $postcode_regex = '/^[0-9]+$/';
- // methods
- public void __construct()
- public void updateCMSFields()
- public void updateFrontEndFields()
- public void populateDefaults()
- public bool hasAddress()
- public string getFullAddress()
- public DBHTMLText getFullAddressHTML()
- public DBHTMLText AddressMap()
- public string getCountryName()
- public bool isAddressChanged()
- private array getAddressFields()
- public array getAllowedStates()
- public array getAllowedCountries()
- private string getPostcodeRegex()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $allowed_countries
—
array
Define an array of countries that the user can select from. - $allowed_states
—
array
Define an array of states that the user can select from. - $db
- $postcode_regex — string
Methods
private
- getAddressFields() — NOTE:
- getPostcodeRegex()
public
- __construct()
- AddressMap() — Returns a static google map of the address, linking out to the address.
- 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()
- updateCMSFields()
- updateFrontEndFields()