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

Class: Address

Source Location: /code/order/Address.php

Class Overview

DataObject
   |
   --Address

Represents a shipping or billing address which are both attached to Order.


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (c) 2011, Frank Mullenger

Variables

Methods



Class Details

[line 11]
Represents a shipping or billing address which are both attached to Order.



Tags:

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


[ Top ]


Class Variables

static $create_table_options = array(
      'MySQLDatabase' => 'ENGINE=InnoDB'
   )

[line 46]

Table type needs to be InnoDB for transaction support (not currently implemented).


Type:   Array


[ Top ]

static $db = array(
      'Type' => "Enum('Billing,Shipping','Billing')",
     'FirstName' => 'Varchar',
      'Surname' => 'Varchar',
     'Company' => 'Varchar',
     'Address' => 'Varchar(255)',
      'AddressLine2' => 'Varchar(255)',
      'City' => 'Varchar(100)',
      'PostalCode' => 'Varchar(30)',
      'State' => 'Varchar(100)',
      'Country' => 'Varchar',
   )

[line 18]

DB fields for an address



Tags:

access:  public

Type:   Array


[ Top ]

static $has_one = array(
      'Order' => 'Order',
     'Member' => 'Customer'
   )

[line 36]

Relations for address



Tags:

access:  public

Type:   Array


[ Top ]



Class Methods


method getCheckoutFormData [line 57]

Array getCheckoutFormData( [ $prefix = 'Billing'])

Return data in an Array with keys formatted to match the field names on the checkout form so that it can be loaded into an order form.



Tags:

return:  Data for loading into the form


Parameters:

   $prefix  

[ Top ]

method validate [line 80]

void validate( )

By default an order is always valid. Empty orders are often created and saved in the DB to represent a cart, so cannot validate that Items and Addresses exist for the order until the checkout process.



[ Top ]


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