Advertisement
Guest User

Untitled

a guest
Sep 6th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.94 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * @copyright Metaways Infosystems GmbH, 2011
  5.  * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
  6.  * @copyright Aimeos (aimeos.org), 2015
  7.  * @package MShop
  8.  * @subpackage Common
  9.  */
  10.  
  11. namespace Aimeos\MShop\Order\Item\Base\Address;
  12.  
  13. class MarchioAddressItem extends \Aimeos\MShop\Order\Item\Base\Address\Standard
  14.     implements \Aimeos\MShop\Order\Item\Base\Address\Iface
  15. {
  16.  
  17.     public function fromArray(array $list)
  18.     {
  19.         $unknown = array();
  20.         $list = parent::fromArray($list);
  21.  
  22.         foreach ($list as $key => $value) {
  23.             switch ($key) {
  24.                 case 'order.base.address.address4':
  25.                     $this->setAddress4($value);
  26.                     break;
  27.                 case 'order.base.address.areacode':
  28.                     $this->setAreaCode($value);
  29.                     break;
  30.                 default:
  31.                     $unknown[$key] = $value;
  32.             }
  33.         }
  34.  
  35.         return $unknown;
  36.     }
  37.  
  38.     public function getAddress4()
  39.     {
  40.         if (isset($this->values['order.base.address.address4'])) {
  41.             return (string)$this->values['order.base.address.address4'];
  42.         }
  43.  
  44.         return '';
  45.     }
  46.  
  47.     public function setAddress4($value)
  48.     {
  49.         if ($value == $this->getAddress4()) {
  50.             return $this;
  51.         }
  52.  
  53.         $this->values['order.base.address.address4'] = $value;
  54.         $this->setModified();
  55.  
  56.         return $this;
  57.     }
  58.  
  59.     public function getAreaCode()
  60.     {
  61.         if (isset($this->values['order.base.address.areacode'])) {
  62.             return (string)$this->values['order.base.address.areacode'];
  63.         }
  64.  
  65.         return '';
  66.     }
  67.  
  68.     public function setAreaCode($value)
  69.     {
  70.         if ($value == $this->getAreaCode()) {
  71.             return $this;
  72.         }
  73.  
  74.         $this->values['order.base.address.areacode'] = $value;
  75.         $this->setModified();
  76.  
  77.         return $this;
  78.     }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement