DHL-PHP-SDK  v0.4
A wrapper for the DHL-XML-API Version 2
PackStation.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Petschko\DHL;
4 
16 use stdClass;
17 
23 class PackStation extends Receiver {
32  private $postNumber = '';
33 
42  private $packStationNumber = '';
43 
47  public function __destruct() {
48  parent::__destruct();
49  unset($this->postNumber);
50  unset($this->packStationNumber);
51  }
52 
58  public function getPostNumber() {
59  return $this->postNumber;
60  }
61 
67  public function setPostNumber($postNumber) {
68  $this->postNumber = $postNumber;
69  }
70 
76  public function getPackStationNumber() {
77  return $this->packStationNumber;
78  }
79 
85  public function setPackStationNumber($packStationNumber) {
86  $this->packStationNumber = $packStationNumber;
87  }
88 
94  public function getClass_v2() {
95  $class = new StdClass;
96  $class->name1 = $this->getName();
97 
98  $class->Communication = new StdClass;
99  if($this->getPhone() !== null)
100  $class->Communication->phone = $this->getPhone();
101  if($this->getEmail() !== null)
102  $class->Communication->email = $this->getEmail();
103  if($this->getContactPerson() !== null)
104  $class->Communication->contactPerson = $this->getContactPerson();
105 
106  $class->Packstation = new StdClass;
107  $class->Packstation->postNumber = $this->getPostNumber();
108  $class->Packstation->packstationNumber = $this->getPackStationNumber();
109  $class->Packstation->zip = $this->getZip();
110  $class->Packstation->city = $this->getLocation();
111 
112  if($this->getCountryISOCode() !== null) {
113  $class->Packstation->Origin = new StdClass;
114 
115  if($this->getCountry() !== null)
116  $class->Packstation->Origin->country = $this->getCountry();
117 
118  $class->Packstation->Origin->countryISOCode = $this->getCountryISOCode();
119 
120  if($this->getState() !== null)
121  $class->Packstation->Origin->state = $this->getState();
122  }
123 
124  return $class;
125  }
126 }
setPostNumber($postNumber)
Definition: PackStation.php:67
setPackStationNumber($packStationNumber)
Definition: PackStation.php:85