ShippingRates/src/Quote.php

132 lines
2.3 KiB
PHP
Raw Normal View History

2014-11-27 13:27:56 -05:00
<?php namespace pdt256\Shipping;
2014-11-30 21:51:16 -05:00
use DateTime;
2014-11-27 13:27:56 -05:00
class Quote
{
protected $code;
protected $name;
protected $cost;
protected $transitTime;
protected $deliveryEstimate;
2014-11-27 13:27:56 -05:00
protected $carrier;
public function __construct($carrier = null, $code = null, $name = null, $cost = null)
{
$this->setCarrier($carrier);
$this->setCode($code);
$this->setName($name);
$this->setCost($cost);
}
2014-11-27 13:27:56 -05:00
/**
* @return mixed
*/
public function getCarrier()
{
return $this->carrier;
}
/**
* @param mixed $carrier
* @return $this
*/
public function setCarrier($carrier)
{
$this->carrier = (string) $carrier;
2014-11-27 13:27:56 -05:00
return $this;
}
/**
* @return mixed
*/
public function getCode()
{
return $this->code;
}
/**
* @param string $code
* @return $this
*/
public function setCode($code)
{
$this->code = (string) $code;
2014-11-27 13:27:56 -05:00
return $this;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
* @return $this
*/
public function setName($name)
{
$this->name = (string) $name;
2014-11-27 13:27:56 -05:00
return $this;
}
/**
* @return mixed
*/
public function getCost()
{
return $this->cost;
}
/**
* Quoted cost of this service, in pennies
*
* @param int $cost
* @return $this
*/
public function setCost($cost)
{
$this->cost = (int) $cost;
2014-11-27 13:27:56 -05:00
return $this;
}
/**
* @return mixed
*/
public function getTransitTime()
{
return $this->transitTime;
2014-11-27 13:27:56 -05:00
}
/**
* @param mixed $transitTime
2014-11-27 13:27:56 -05:00
* @return $this
*/
public function setTransitTime($transitTime)
2014-11-27 13:27:56 -05:00
{
$this->transitTime = $transitTime;
2014-11-27 13:27:56 -05:00
return $this;
}
/**
* @return mixed
*/
public function getDeliveryEstimate()
{
return $this->deliveryEstimate;
2014-11-27 13:27:56 -05:00
}
/**
* @param DateTime $deliveryEstimate
2014-11-27 13:27:56 -05:00
* @return $this
*/
public function setDeliveryEstimate(DateTime $deliveryEstimate)
2014-11-27 13:27:56 -05:00
{
$this->deliveryEstimate = $deliveryEstimate;
2014-11-27 13:27:56 -05:00
return $this;
}
}