| 1 | <?php |
||
| 8 | class ShippingMethod extends DataObject |
||
| 9 | { |
||
| 10 | private static $db = array( |
||
|
|
|||
| 11 | "Name" => "Varchar", |
||
| 12 | "Description" => "Text", |
||
| 13 | "Enabled" => "Boolean" |
||
| 14 | ); |
||
| 15 | |||
| 16 | private static $casting = array( |
||
| 17 | 'Rate' => 'Currency' |
||
| 18 | ); |
||
| 19 | |||
| 20 | public function getCalculator(Order $order) |
||
| 24 | |||
| 25 | public function calculateRate(ShippingPackage $package, Address $address) |
||
| 29 | |||
| 30 | public function getRate() |
||
| 34 | |||
| 35 | public function getTitle() |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Some shipping methods might require an address present on the order. |
||
| 49 | * |
||
| 50 | * @return bool |
||
| 51 | */ |
||
| 52 | public function requiresAddress() |
||
| 56 | } |
||
| 57 | |||
| 80 |