Sunnysideup\Ecommerce\Model\Address\OrderAddress
This is a base-class for both.
Synopsis
class OrderAddress
extends DataObject
implements
EditableEcommerceObject
{
- // members
- protected array $readOnlyFields = ;
- protected null|bool $_canEdit;
- protected null|bool $_canView;
- private static bool $use_separate_shipping_address = false;
- private static bool $use_shipping_address_for_main_region_and_country = false;
- private static string $field_class_and_id_prefix = '';
- private static string $singular_name = 'Order Address';
- private static string $plural_name = 'Order Addresses';
- private static string $table_name = 'OrderAddress';
- private static array $casting = ;
- // methods
- public void i18n_singular_name()
- public void i18n_plural_name()
- public static string get_country_field_ID()
- public static string get_region_field_ID()
- public void addReadonlyField()
- public void removeReadonlyField()
- public string CMSEditLink()
- public void canCreate()
- public bool canView()
- public bool canEdit()
- public void canDelete()
- public FieldList scaffoldSearchFields()
- public void SetRegionFields()
- public void SetCountryFields()
- public string getFullName()
- public void FullName()
- public string FullString()
- public void getFullString()
- public string comparisonString()
- public BillingAddress|OrderAddress|ShippingAddress FillWithLastAddressFromMember()
- public null|Member getMemberFromOrder()
- public void MakeObsolete()
- public string RemoveLink()
- public string getJSONData()
- public void JSONData()
- public void debug()
- protected void onAfterWrite()
- protected void onBeforeWrite()
- protected FieldList getEcommerceFields()
- protected TextField getPostalCodeField()
- protected DropdownField getRegionField()
- protected DropdownField getCountryField()
- protected FieldList makeSelectedFieldsReadOnly()
- protected void baseClassLinkingToOrder()
- protected void fieldPrefix()
- // Inherited methods from OrderCached
- public void setOrderCached()
- public Order|null; getOrderCached()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Uses
Implements
Tasks
Line | Task |
---|---|
406+ | : are there times when the Shipping rather than the Billing address should be linked? Copies the last address used by the member. |
452+ | : can wre write $this->getOrderCached() instead???? |
Members
private
-
$casting
standard SS static definition. - $field_class_and_id_prefix — string
-
$plural_name
standard SS static definition. -
$singular_name
standard SS static definition. -
$table_name
standard SS static definition. - $use_separate_shipping_address — Sunnysideup\Ecommerce\Model\Address\bool
- $use_shipping_address_for_main_region_and_country — Sunnysideup\Ecommerce\Model\Address\bool
protected
- $_canEdit
—
Sunnysideup\Ecommerce\Model\Address\null|bool
save edit status for speed's sake. - $_canView
—
Sunnysideup\Ecommerce\Model\Address\null|bool
save view status for speed's sake. - $orderCached — Sunnysideup\Ecommerce\Model\Order
- $orderCachedStatusID — int
- $readOnlyFields
—
array
There might be times when a modifier needs to make an address field read-only.
Methods
protected
- baseClassLinkingToOrder() — returns the field prefix string for shipping addresses.
- fieldPrefix() — returns the field prefix string for shipping addresses.
- getCountryField() — put together a dropdown for the country field.
- getEcommerceFields()
- getPostalCodeField() — put together a textfield for a postal code field.
- getRegionField() — put together a dropdown for the region field.
- makeSelectedFieldsReadOnly() — makes selected fields into read only using the $this->readOnlyFields array.
- onAfterWrite() — standard SS method We "hackishly" ensure that the OrderID is set to the right value.
- onBeforeWrite() — standard SS Method saves the region code.
public
- CMSEditLink() — link to edit the record.
- FillWithLastAddressFromMember()
- FullName()
- FullString() — Casted variable returns the full strng of the record.
- JSONData()
- MakeObsolete() — make an address obsolete and include all the addresses that are identical.
- RemoveLink() — returns the link that can be used to remove (make Obsolete) an address.
- SetCountryFields() — Saves country - both shipping and billing fields are saved here for convenience sake (only one actually gets saved) NOTE: do not call this method SetCountry as this has a special meaning!
- SetRegionFields() — Saves region - both shipping and billing fields are saved here for convenience sake (only one actually gets saved) NOTE: do not call this method SetCountry as this has a special meaning! *.
- addReadonlyField() — sets a field to readonly state we use this when modifiers have been set that require a field to be a certain value for example - a PostalCode field maybe set in the modifier.
- canCreate()
- canDelete()
- canEdit() — Standard SS method This is an important method.
- canView() — Standard SS method This is an important method.
- comparisonString() — returns a string that can be used to find out if two addresses are the same.
- debug()
- getFullName() — Casted variable returns the full name of the person, e.g. "John Smith".
- getFullString()
- getJSONData() — converts an address into JSON.
- getMemberFromOrder() — find the member associated with the current Order and address.
- get_country_field_ID() — returns the id of the MAIN country field for template manipulation.
- get_region_field_ID() — returns the id of the MAIN region field for template manipulation.
- i18n_plural_name()
- i18n_singular_name()
- removeReadonlyField() — removes a field from the readonly state.
- scaffoldSearchFields() — Determine which properties on the DataObject are searchable, and map them to their default {@link FormField} representations. Used for scaffolding a searchform for {@link ModelAdmin}.