* @author Dennis Eichhorn * @copyright 2013 Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ namespace phpOMS\Datatypes; use phpOMS\Contract\JsonableInterface; /** * Address class. * * @category Framework * @package phpOMS\Datatypes * @author OMS Development Team * @author Dennis Eichhorn * @license OMS License 1.0 * @link http://orange-management.com * @since 1.0.0 */ class Address implements JsonableInterface { /** * Name of the receiver. * * @var \string * @since 1.0.0 */ private $recipient = null; /** * Sub of the address. * * @var \string * @since 1.0.0 */ private $fao = null; /** * Location. * * @var Location * @since 1.0.0 */ private $location = null; /** * Constructor. * * @since 1.0.0 * @author Dennis Eichhorn */ public function __construct() { $this->location = new Location(); } /** * Get recipient. * * @return \string * * @since 1.0.0 * @author Dennis Eichhorn */ public function getRecipient() : \string { return $this->recipient; } /** * Set recipient. * * @param \string $recipient Recipient * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ public function setRecipient(\string $recipient) { $this->recipient = $recipient; } /** * Get FAO. * * @return \string * * @since 1.0.0 * @author Dennis Eichhorn */ public function getFAO() : \string { return $this->fao; } /** * Set FAO. * * @param \string $fao FAO * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ public function setFAO(\string $fao) { $this->fao = $fao; } /** * Get location. * * @return Location * * @since 1.0.0 * @author Dennis Eichhorn */ public function getLocation() : Location { return $this->location; } /** * Set location. * * @param Location $location Location * * @return void * * @since 1.0.0 * @author Dennis Eichhorn */ public function setLocation(Location $location) { $this->location = $location; } /** * {@inheritdoc} */ public function toArray() : array { return ['recipient' => $this->recipient, 'fao' => $this->fao, 'location' => $this->location->toArray()]; } /** * {@inheritdoc} */ public function toJson(\int $option = 0) : \string { return json_encode($this->toArray()); } }