DHL-PHP-SDK  v0.4
A wrapper for the DHL-XML-API Version 2
Filial.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Petschko\DHL;
4 
16 use stdClass;
17 
23 class Filial extends Receiver {
32  private $postNumber = '';
33 
42  private $filialNumber = '';
43 
47  public function __destruct() {
48  parent::__destruct();
49  unset($this->postNumber);
50  unset($this->filialNumber);
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 getFilialNumber() {
77  return $this->filialNumber;
78  }
79 
85  public function getPostFilialNumber() {
86  return $this->filialNumber;
87  }
88 
94  public function setFilialNumber($filialNumber) {
95  $this->filialNumber = $filialNumber;
96  }
97 
103  public function setPostFilialNumber($filialNumber) {
104  $this->filialNumber = $filialNumber;
105  }
106 
112  public function getClass_v2() {
113  $class = new StdClass;
114  $class->name1 = $this->getName();
115 
116  $class->Communication = new StdClass;
117  if($this->getPhone() !== null)
118  $class->Communication->phone = $this->getPhone();
119  if($this->getEmail() !== null)
120  $class->Communication->email = $this->getEmail();
121  if($this->getContactPerson() !== null)
122  $class->Communication->contactPerson = $this->getContactPerson();
123 
124  $class->Postfiliale = new StdClass;
125  $class->Postfiliale->postfilialNumber = $this->getFilialNumber();
126  $class->Postfiliale->postNumber = $this->getPostNumber();
127  $class->Postfiliale->zip = $this->getZip();
128  $class->Postfiliale->city = $this->getLocation();
129 
130  if($this->getCountryISOCode() !== null) {
131  $class->Postfiliale->Origin = new StdClass;
132 
133  if($this->getCountry() !== null)
134  $class->Postfiliale->Origin->country = $this->getCountry();
135 
136  $class->Postfiliale->Origin->countryISOCode = $this->getCountryISOCode();
137 
138  if($this->getState() !== null)
139  $class->Postfiliale->Origin->state = $this->getState();
140  }
141 
142  return $class;
143  }
144 }
setFilialNumber($filialNumber)
Definition: Filial.php:94
setPostFilialNumber($filialNumber)
Definition: Filial.php:103
setPostNumber($postNumber)
Definition: Filial.php:67