SilverCommerce\Postage\Helpers\Parcel
A parcel is a generic object that can be handed to the postage calculator to find the best applicable shipping rate.
NOTE Thanks to SilverShop for this idea!
Synopsis
class Parcel
{
- // members
- protected integer $width = 0;
- protected integer $height = 0;
- protected integer $depth = 0;
- protected integer $weight = 0;
- protected integer $items = 0;
- protected integer $value = 0;
- protected $country = NULL;
- protected $region = NULL;
- protected $address = NULL;
- protected $latitude = NULL;
- protected $longditude = NULL;
- // methods
- public void getWidth()
- public void setWidth()
- public void getHeight()
- public void setHeight()
- public void getDepth()
- public void setDepth()
- public void getWeight()
- public void setWeight()
- public void getItems()
- public void setItems()
- public void getValue()
- public Parcel setValue()
- public void getCountry()
- public void setCountry()
- public void getRegion()
- public void setRegion()
- public void getAddress()
- public void setAddress()
- public void getLatitude()
- public void setLatitude()
- public void getLongditude()
- public void setLongditude()
- public void getVolume()
- public void __construct()
- public ArrayList getPostageOptions()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
Members
protected
- $address
—
string
Optional full address that this parcel needs to be delivered to - $country
—
string
The country this parcel is to be delivered to - $depth
—
int
Total depth of the package - $height
—
int
Total height of the package - $items
—
int
Total number of items in the package - $latitude
—
string
Optional latitude of the address that this parcel needs to be delivered to (useful for things like distance based shipping using geo-location) - $longditude
—
string
Optional longditude of the address that this parcel needs to be delivered to (useful for things like distance based shipping using geo-location) - $region
—
string
The region witin a country this parcel is to be delivered to - $value
—
float
The total monitary value of this parcel - $weight
—
int
Total weight of the package - $width
—
int
Total width of the package
Methods
public
- __construct() — Initialise this Package
- getAddress()
- getCountry()
- getDepth()
- getHeight()
- getItems()
- getLatitude()
- getLongditude()
- getPostageOptions() — Generate a list of availabe postage options, from the current available Postage Types.
- getRegion()
- getValue() — Get the value of value
- getVolume() — Calculate total volume
- getWeight()
- getWidth()
- setAddress()
- setCountry()
- setDepth()
- setHeight()
- setItems()
- setLatitude()
- setLongditude()
- setRegion()
- setValue() — Set the value of value
- setWeight()
- setWidth()