swipestripe
[ class tree: swipestripe ] [ index: swipestripe ] [ all elements ]

Class: Customer

Source Location: /code/customer/Customer.php

Class Overview

Member
   |
   --Customer

Represents a Customer, a type of Member.


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (c) 2011, Frank Mullenger

Variables

Methods



Class Details

[line 11]
Represents a Customer, a type of Member.



Tags:

author:  Frank Mullenger <frankmullenger@gmail.com>
version:  1.0
copyright:  Copyright (c) 2011, Frank Mullenger


[ Top ]


Class Variables

static $db = array(
      'Address' => 'Varchar(255)',
      'AddressLine2' => 'Varchar(255)',
      'City' => 'Varchar(100)',
      'PostalCode' => 'Varchar(30)',
      'State' => 'Varchar(100)',
      'Country' => 'Varchar',
      'HomePhone' => 'Varchar(100)',
      'Notes' => 'HTMLText' //TODO remove? Is this necessary for Payment class or something?
   )

[line 19]

Extra DB fields, mostly for address - requirements for the Payment class.

Also ties Member class with Address and Order classes.



Type:   Array


[ Top ]

static $has_many = array(
     'Addresses' => 'Address',
     'Orders' => 'Order'
   )

[line 35]

Link customers to Addresses and Orders.


Type:   Array


[ Top ]



Class Methods


static method currentUser [line 151]

static bool|Member currentUser( )

Returns the current logged in customer



Tags:

return:  Returns the member object of the current logged in user or FALSE.


[ Top ]

method BillingAddress [line 105]

Address BillingAddress( )

Retrieve the last used billing address for this Member from their previous saved addresses.

TODO make this more efficient




Tags:

return:  The last billing address


[ Top ]

method canDelete [line 65]

void canDelete( [ $member = null])

Prevent customers from being deleted.



Tags:

access:  public


Parameters:

   $member  

[ Top ]

method getCMSFields [line 74]

FieldSet getCMSFields( )

Add some fields for managing Members in the CMS.



Tags:

access:  public


[ Top ]

method onBeforeDelete [line 46]

void onBeforeDelete( )

If this Member has Orders, then prevent member from being deleted.

Belt and braces now, @see Customer::canDelete()




[ Top ]

method Orders [line 139]

DataObjectSet Orders( )

Overload getter to return only non-cart orders



Tags:

return:  Set of previous orders for this member


[ Top ]

method ShippingAddress [line 123]

Address ShippingAddress( )

Retrieve the last used shipping address for this Member from their previous saved addresses.

TODO make this more efficient




Tags:

return:  The last shipping address


[ Top ]


Documentation generated on Thu, 08 Mar 2012 16:47:25 +1300 by phpDocumentor 1.4.4