Version: current

     1 <?php
     2 /**
     3  * ShopMember provides customisations to {@link Member} for shop purposes
     4  *
     5  * @package cart_shipping
     6  * @author menedem
     7  */
     8 class ShippingMemberDecorator extends DataObjectDecorator {
     9
    10     function extraStatics() {
    11         return array(
    12             'has_many' => array(
    13                 'AddressBook' => 'Address',
    14             ),
    15             'has_one' => array(
    16                 'DefaultShippingAddress' => 'Address',
    17             )
    18         );
    19     }
    20
    21     function updateCMSFields(& $fields) {
    22         $tf = new ComplexTableField($this->owner, 'AddressBook', 'Address', array('FullAddress' => _t('Address.FullAddress', 'Full Address')), null, 'MemberID = ' . $this->owner->ID);
    23         $fields->replaceField('AddressBook', $tf);
    24     }
    25
    26     function updateFrontEndFields(& $fields) {
    27         $fields->removeByName('DefaultShippingAddressID');
    28     }
    29
    30
    31
    32 }
    33

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -