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

Class: Modification

Source Location: /code/order/Modification.php

Class Overview

DataObject
   |
   --Modification

Modification for the Order, saves data that is set by Modifiers


Author(s):

Version:

  • 1.0

Copyright:

  • Copyright (c) 2011, Frank Mullenger

Variables

Methods



Class Details

[line 15]
Modification for the Order, saves data that is set by Modifiers

e.g: shipping, tax, vouchers etc. Instead of linking to a Modifier it takes the Amount that the modifier will ammend the Order total by and the Description of the Modifier and saves that - denormalising the data - so that Modifiers can be deleted without losing any information from the 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 53]

Set table to InnoDB in preparation for transaction support.


Type:   Array


[ Top ]

static $currency =  'NZD'

[line 46]

Modifier currency TODO move currency to one central location



Tags:

var:  3 letter ISO 4217 currency code e.g. "NZD"
access:  protected

Type:   String


[ Top ]

static $db = array(
     'ModifierClass' => 'Varchar',
      'ModifierOptionID' => 'Int', 
     'Amount' => 'Money',
     'Description' => 'Text'
   )

[line 24]

DB fields for the order Modification, the actual Modifier data is saved into this class so if a modifier is deleted the order still has the necessary details.



Tags:

access:  public

Type:   Array


[ Top ]

static $has_one = array(
     'Order' => 'Order'
   )

[line 36]

Relations for this class



Tags:

access:  public

Type:   Array


[ Top ]



Class Methods


static method currency [line 71]

static string currency( )

Return the currency set for Order Modifications



Tags:

return:  3 letter ISO 4217 currency code e.g. "NZD"
access:  public


[ Top ]

static method set_currency [line 62]

static void set_currency( string $currency)

Set the currency code that this site uses for Order Modifications



Tags:

access:  public


Parameters:

string   $currency   3 letter ISO 4217 currency code e.g. "NZD"

[ Top ]

method validate [line 80]

void validate( )

By default Modifications are valid



[ Top ]


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