From 2ab761b315815f472b002525a2ae866d7476d79d Mon Sep 17 00:00:00 2001 From: Mikael DELSOL Date: Mon, 11 Apr 2016 22:31:45 +0200 Subject: [PATCH 1/2] [update] package updated with the last version of PackageGenerator version It uses the last WSDL version available at this time --- src/ClassMap.php | 2 + src/StructType/Article.php | 100 ++++++++++- src/StructType/BaseResponse.php | 2 +- src/StructType/Contents.php | 67 ++++++- src/StructType/CustomsDeclarations.php | 132 +++++++++++++- src/StructType/ElementVisual.php | 137 ++++++++++++++ src/StructType/Fields.php | 2 +- src/StructType/GetListMailBoxPickingDates.php | 9 +- .../GetListMailBoxPickingDatesResponse.php | 6 +- ...GetListMailBoxPickingDatesResponseType.php | 2 +- src/StructType/GetProductInter.php | 6 +- .../GetProductInterResponseType.php | 4 +- src/StructType/Original.php | 169 ++++++++++++++++++ src/StructType/OutputFormat.php | 32 +++- src/StructType/Routing.php | 30 ++-- src/StructType/XmlResponse.php | 63 ++++++- 16 files changed, 719 insertions(+), 44 deletions(-) create mode 100644 src/StructType/ElementVisual.php create mode 100644 src/StructType/Original.php diff --git a/src/ClassMap.php b/src/ClassMap.php index 1f705e6..415b489 100644 --- a/src/ClassMap.php +++ b/src/ClassMap.php @@ -25,6 +25,7 @@ final public static function get() 'contents' => 'ColissimoPostage\StructType\Contents', 'article' => 'ColissimoPostage\StructType\Article', 'category' => 'ColissimoPostage\StructType\Category', + 'original' => 'ColissimoPostage\StructType\Original', 'sender' => 'ColissimoPostage\StructType\Sender', 'address' => 'ColissimoPostage\StructType\Address', 'addressee' => 'ColissimoPostage\StructType\Addressee', @@ -42,6 +43,7 @@ final public static function get() 'belgiumLabel' => 'ColissimoPostage\StructType\BelgiumLabel', 'codeVAS' => 'ColissimoPostage\StructType\CodeVAS', 'returnAddressBelgium' => 'ColissimoPostage\StructType\ReturnAddressBelgium', + 'elementVisual' => 'ColissimoPostage\StructType\ElementVisual', 'pickupLocation' => 'ColissimoPostage\StructType\PickupLocation', 'addressPickupLocation' => 'ColissimoPostage\StructType\AddressPickupLocation', 'routing' => 'ColissimoPostage\StructType\Routing', diff --git a/src/StructType/Article.php b/src/StructType/Article.php index b68c26b..a5d948e 100644 --- a/src/StructType/Article.php +++ b/src/StructType/Article.php @@ -47,6 +47,27 @@ class Article extends AbstractStructBase * @var string */ public $originCountry; + /** + * The currency + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $currency; + /** + * The artref + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $artref; + /** + * The originalIdent + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $originalIdent; /** * Constructor method for article * @uses Article::setDescription() @@ -55,14 +76,20 @@ class Article extends AbstractStructBase * @uses Article::setValue() * @uses Article::setHsCode() * @uses Article::setOriginCountry() + * @uses Article::setCurrency() + * @uses Article::setArtref() + * @uses Article::setOriginalIdent() * @param string $description * @param int $quantity * @param float $weight * @param float $value * @param string $hsCode * @param string $originCountry + * @param string $currency + * @param string $artref + * @param string $originalIdent */ - public function __construct($description = null, $quantity = null, $weight = null, $value = null, $hsCode = null, $originCountry = null) + public function __construct($description = null, $quantity = null, $weight = null, $value = null, $hsCode = null, $originCountry = null, $currency = null, $artref = null, $originalIdent = null) { $this ->setDescription($description) @@ -70,7 +97,10 @@ public function __construct($description = null, $quantity = null, $weight = nul ->setWeight($weight) ->setValue($value) ->setHsCode($hsCode) - ->setOriginCountry($originCountry); + ->setOriginCountry($originCountry) + ->setCurrency($currency) + ->setArtref($artref) + ->setOriginalIdent($originalIdent); } /** * Get description value @@ -196,6 +226,72 @@ public function setOriginCountry($originCountry = null) $this->originCountry = $originCountry; return $this; } + /** + * Get currency value + * @return string|null + */ + public function getCurrency() + { + return $this->currency; + } + /** + * Set currency value + * @param string $currency + * @return \ColissimoPostage\StructType\Article + */ + public function setCurrency($currency = null) + { + // validation for constraint: string + if (!is_null($currency) && !is_string($currency)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($currency)), __LINE__); + } + $this->currency = $currency; + return $this; + } + /** + * Get artref value + * @return string|null + */ + public function getArtref() + { + return $this->artref; + } + /** + * Set artref value + * @param string $artref + * @return \ColissimoPostage\StructType\Article + */ + public function setArtref($artref = null) + { + // validation for constraint: string + if (!is_null($artref) && !is_string($artref)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($artref)), __LINE__); + } + $this->artref = $artref; + return $this; + } + /** + * Get originalIdent value + * @return string|null + */ + public function getOriginalIdent() + { + return $this->originalIdent; + } + /** + * Set originalIdent value + * @param string $originalIdent + * @return \ColissimoPostage\StructType\Article + */ + public function setOriginalIdent($originalIdent = null) + { + // validation for constraint: string + if (!is_null($originalIdent) && !is_string($originalIdent)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originalIdent)), __LINE__); + } + $this->originalIdent = $originalIdent; + return $this; + } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/BaseResponse.php b/src/StructType/BaseResponse.php index 2ae1c15..7b7dbc6 100644 --- a/src/StructType/BaseResponse.php +++ b/src/StructType/BaseResponse.php @@ -57,7 +57,7 @@ public function setMessages(array $messages = array()) throw new \InvalidArgumentException(sprintf('The messages property can only contain items of \ColissimoPostage\StructType\Message, "%s" given', is_object($baseResponseMessagesItem) ? get_class($baseResponseMessagesItem) : gettype($baseResponseMessagesItem)), __LINE__); } } - if (is_null($messages)) { + if (is_null($messages) || (is_array($messages) && empty($messages))) { unset($this->messages); } else { $this->messages = $messages; diff --git a/src/StructType/Contents.php b/src/StructType/Contents.php index e312261..0fa24fc 100644 --- a/src/StructType/Contents.php +++ b/src/StructType/Contents.php @@ -27,18 +27,30 @@ class Contents extends AbstractStructBase * @var \ColissimoPostage\StructType\Category */ public $category; + /** + * The original + * Meta informations extracted from the WSDL + * - maxOccurs: unbounded + * - minOccurs: 0 + * - nillable: true + * @var \ColissimoPostage\StructType\Original[] + */ + public $original; /** * Constructor method for contents * @uses Contents::setArticle() * @uses Contents::setCategory() + * @uses Contents::setOriginal() * @param \ColissimoPostage\StructType\Article[] $article * @param \ColissimoPostage\StructType\Category $category + * @param \ColissimoPostage\StructType\Original[] $original */ - public function __construct(array $article = array(), \ColissimoPostage\StructType\Category $category = null) + public function __construct(array $article = array(), \ColissimoPostage\StructType\Category $category = null, array $original = array()) { $this ->setArticle($article) - ->setCategory($category); + ->setCategory($category) + ->setOriginal($original); } /** * Get article value @@ -67,7 +79,7 @@ public function setArticle(array $article = array()) throw new \InvalidArgumentException(sprintf('The article property can only contain items of \ColissimoPostage\StructType\Article, "%s" given', is_object($contentsArticleItem) ? get_class($contentsArticleItem) : gettype($contentsArticleItem)), __LINE__); } } - if (is_null($article)) { + if (is_null($article) || (is_array($article) && empty($article))) { unset($this->article); } else { $this->article = $article; @@ -107,6 +119,55 @@ public function setCategory(\ColissimoPostage\StructType\Category $category = nu $this->category = $category; return $this; } + /** + * Get original value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \ColissimoPostage\StructType\Original[]|null + */ + public function getOriginal() + { + return isset($this->original) ? $this->original : null; + } + /** + * Set original value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @throws \InvalidArgumentException + * @param \ColissimoPostage\StructType\Original[] $original + * @return \ColissimoPostage\StructType\Contents + */ + public function setOriginal(array $original = array()) + { + foreach ($original as $contentsOriginalItem) { + // validation for constraint: itemType + if (!$contentsOriginalItem instanceof \ColissimoPostage\StructType\Original) { + throw new \InvalidArgumentException(sprintf('The original property can only contain items of \ColissimoPostage\StructType\Original, "%s" given', is_object($contentsOriginalItem) ? get_class($contentsOriginalItem) : gettype($contentsOriginalItem)), __LINE__); + } + } + if (is_null($original) || (is_array($original) && empty($original))) { + unset($this->original); + } else { + $this->original = $original; + } + return $this; + } + /** + * Add item to original value + * @throws \InvalidArgumentException + * @param \ColissimoPostage\StructType\Original $item + * @return \ColissimoPostage\StructType\Contents + */ + public function addToOriginal(\ColissimoPostage\StructType\Original $item) + { + // validation for constraint: itemType + if (!$item instanceof \ColissimoPostage\StructType\Original) { + throw new \InvalidArgumentException(sprintf('The original property can only contain items of \ColissimoPostage\StructType\Original, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + } + $this->original[] = $item; + return $this; + } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/CustomsDeclarations.php b/src/StructType/CustomsDeclarations.php index 479f88d..9d2ff2b 100644 --- a/src/StructType/CustomsDeclarations.php +++ b/src/StructType/CustomsDeclarations.php @@ -46,6 +46,34 @@ class CustomsDeclarations extends AbstractStructBase * @var string */ public $officeOrigin; + /** + * The comments + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $comments; + /** + * The invoiceNumber + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $invoiceNumber; + /** + * The licenceNumber + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $licenceNumber; + /** + * The certificatNumber + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $certificatNumber; /** * Constructor method for customsDeclarations * @uses CustomsDeclarations::setIncludeCustomsDeclarations() @@ -53,20 +81,32 @@ class CustomsDeclarations extends AbstractStructBase * @uses CustomsDeclarations::setImportersReference() * @uses CustomsDeclarations::setImportersContact() * @uses CustomsDeclarations::setOfficeOrigin() + * @uses CustomsDeclarations::setComments() + * @uses CustomsDeclarations::setInvoiceNumber() + * @uses CustomsDeclarations::setLicenceNumber() + * @uses CustomsDeclarations::setCertificatNumber() * @param bool $includeCustomsDeclarations * @param \ColissimoPostage\StructType\Contents $contents * @param string $importersReference * @param string $importersContact * @param string $officeOrigin + * @param string $comments + * @param string $invoiceNumber + * @param string $licenceNumber + * @param string $certificatNumber */ - public function __construct($includeCustomsDeclarations = null, \ColissimoPostage\StructType\Contents $contents = null, $importersReference = null, $importersContact = null, $officeOrigin = null) + public function __construct($includeCustomsDeclarations = null, \ColissimoPostage\StructType\Contents $contents = null, $importersReference = null, $importersContact = null, $officeOrigin = null, $comments = null, $invoiceNumber = null, $licenceNumber = null, $certificatNumber = null) { $this ->setIncludeCustomsDeclarations($includeCustomsDeclarations) ->setContents($contents) ->setImportersReference($importersReference) ->setImportersContact($importersContact) - ->setOfficeOrigin($officeOrigin); + ->setOfficeOrigin($officeOrigin) + ->setComments($comments) + ->setInvoiceNumber($invoiceNumber) + ->setLicenceNumber($licenceNumber) + ->setCertificatNumber($certificatNumber); } /** * Get includeCustomsDeclarations value @@ -170,6 +210,94 @@ public function setOfficeOrigin($officeOrigin = null) $this->officeOrigin = $officeOrigin; return $this; } + /** + * Get comments value + * @return string|null + */ + public function getComments() + { + return $this->comments; + } + /** + * Set comments value + * @param string $comments + * @return \ColissimoPostage\StructType\CustomsDeclarations + */ + public function setComments($comments = null) + { + // validation for constraint: string + if (!is_null($comments) && !is_string($comments)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($comments)), __LINE__); + } + $this->comments = $comments; + return $this; + } + /** + * Get invoiceNumber value + * @return string|null + */ + public function getInvoiceNumber() + { + return $this->invoiceNumber; + } + /** + * Set invoiceNumber value + * @param string $invoiceNumber + * @return \ColissimoPostage\StructType\CustomsDeclarations + */ + public function setInvoiceNumber($invoiceNumber = null) + { + // validation for constraint: string + if (!is_null($invoiceNumber) && !is_string($invoiceNumber)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($invoiceNumber)), __LINE__); + } + $this->invoiceNumber = $invoiceNumber; + return $this; + } + /** + * Get licenceNumber value + * @return string|null + */ + public function getLicenceNumber() + { + return $this->licenceNumber; + } + /** + * Set licenceNumber value + * @param string $licenceNumber + * @return \ColissimoPostage\StructType\CustomsDeclarations + */ + public function setLicenceNumber($licenceNumber = null) + { + // validation for constraint: string + if (!is_null($licenceNumber) && !is_string($licenceNumber)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($licenceNumber)), __LINE__); + } + $this->licenceNumber = $licenceNumber; + return $this; + } + /** + * Get certificatNumber value + * @return string|null + */ + public function getCertificatNumber() + { + return $this->certificatNumber; + } + /** + * Set certificatNumber value + * @param string $certificatNumber + * @return \ColissimoPostage\StructType\CustomsDeclarations + */ + public function setCertificatNumber($certificatNumber = null) + { + // validation for constraint: string + if (!is_null($certificatNumber) && !is_string($certificatNumber)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($certificatNumber)), __LINE__); + } + $this->certificatNumber = $certificatNumber; + return $this; + } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/ElementVisual.php b/src/StructType/ElementVisual.php new file mode 100644 index 0000000..cb98f2e --- /dev/null +++ b/src/StructType/ElementVisual.php @@ -0,0 +1,137 @@ + + */ +class ElementVisual extends AbstractStructBase +{ + /** + * The name + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $name; + /** + * The position + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $position; + /** + * The shortcut + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $shortcut; + /** + * Constructor method for elementVisual + * @uses ElementVisual::setName() + * @uses ElementVisual::setPosition() + * @uses ElementVisual::setShortcut() + * @param string $name + * @param string $position + * @param string $shortcut + */ + public function __construct($name = null, $position = null, $shortcut = null) + { + $this + ->setName($name) + ->setPosition($position) + ->setShortcut($shortcut); + } + /** + * Get name value + * @return string|null + */ + public function getName() + { + return $this->name; + } + /** + * Set name value + * @param string $name + * @return \ColissimoPostage\StructType\ElementVisual + */ + public function setName($name = null) + { + // validation for constraint: string + if (!is_null($name) && !is_string($name)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($name)), __LINE__); + } + $this->name = $name; + return $this; + } + /** + * Get position value + * @return string|null + */ + public function getPosition() + { + return $this->position; + } + /** + * Set position value + * @param string $position + * @return \ColissimoPostage\StructType\ElementVisual + */ + public function setPosition($position = null) + { + // validation for constraint: string + if (!is_null($position) && !is_string($position)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($position)), __LINE__); + } + $this->position = $position; + return $this; + } + /** + * Get shortcut value + * @return string|null + */ + public function getShortcut() + { + return $this->shortcut; + } + /** + * Set shortcut value + * @param string $shortcut + * @return \ColissimoPostage\StructType\ElementVisual + */ + public function setShortcut($shortcut = null) + { + // validation for constraint: string + if (!is_null($shortcut) && !is_string($shortcut)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shortcut)), __LINE__); + } + $this->shortcut = $shortcut; + return $this; + } + /** + * Method called when an object has been exported with var_export() functions + * It allows to return an object instantiated with the values + * @see AbstractStructBase::__set_state() + * @uses AbstractStructBase::__set_state() + * @param array $array the exported values + * @return \ColissimoPostage\StructType\ElementVisual + */ + public static function __set_state(array $array) + { + return parent::__set_state($array); + } + /** + * Method returning the class name + * @return string __CLASS__ + */ + public function __toString() + { + return __CLASS__; + } +} diff --git a/src/StructType/Fields.php b/src/StructType/Fields.php index 3815ab8..75ba844 100644 --- a/src/StructType/Fields.php +++ b/src/StructType/Fields.php @@ -57,7 +57,7 @@ public function setField(array $field = array()) throw new \InvalidArgumentException(sprintf('The field property can only contain items of \ColissimoPostage\StructType\Field, "%s" given', is_object($fieldsFieldItem) ? get_class($fieldsFieldItem) : gettype($fieldsFieldItem)), __LINE__); } } - if (is_null($field)) { + if (is_null($field) || (is_array($field) && empty($field))) { unset($this->field); } else { $this->field = $field; diff --git a/src/StructType/GetListMailBoxPickingDates.php b/src/StructType/GetListMailBoxPickingDates.php index 8913467..e8da423 100644 --- a/src/StructType/GetListMailBoxPickingDates.php +++ b/src/StructType/GetListMailBoxPickingDates.php @@ -23,8 +23,7 @@ class GetListMailBoxPickingDates extends AbstractStructBase /** * Constructor method for getListMailBoxPickingDates * @uses GetListMailBoxPickingDates::setGetListMailBoxPickingDatesRetourRequest() - * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest - * $getListMailBoxPickingDatesRetourRequest + * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest $getListMailBoxPickingDatesRetourRequest */ public function __construct(\ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest $getListMailBoxPickingDatesRetourRequest = null) { @@ -33,8 +32,7 @@ public function __construct(\ColissimoPostage\StructType\GetListMailBoxPickingDa } /** * Get getListMailBoxPickingDatesRetourRequest value - * @return - * \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest|null + * @return \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest|null */ public function getGetListMailBoxPickingDatesRetourRequest() { @@ -42,8 +40,7 @@ public function getGetListMailBoxPickingDatesRetourRequest() } /** * Set getListMailBoxPickingDatesRetourRequest value - * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest - * $getListMailBoxPickingDatesRetourRequest + * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest $getListMailBoxPickingDatesRetourRequest * @return \ColissimoPostage\StructType\GetListMailBoxPickingDates */ public function setGetListMailBoxPickingDatesRetourRequest(\ColissimoPostage\StructType\GetListMailBoxPickingDatesRetourRequest $getListMailBoxPickingDatesRetourRequest = null) diff --git a/src/StructType/GetListMailBoxPickingDatesResponse.php b/src/StructType/GetListMailBoxPickingDatesResponse.php index 90f0292..81604b5 100644 --- a/src/StructType/GetListMailBoxPickingDatesResponse.php +++ b/src/StructType/GetListMailBoxPickingDatesResponse.php @@ -23,8 +23,7 @@ class GetListMailBoxPickingDatesResponse extends AbstractStructBase /** * Constructor method for getListMailBoxPickingDatesResponse * @uses GetListMailBoxPickingDatesResponse::setReturn() - * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType - * $return + * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType $return */ public function __construct(\ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType $return = null) { @@ -41,8 +40,7 @@ public function getReturn() } /** * Set return value - * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType - * $return + * @param \ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType $return * @return \ColissimoPostage\StructType\GetListMailBoxPickingDatesResponse */ public function setReturn(\ColissimoPostage\StructType\GetListMailBoxPickingDatesResponseType $return = null) diff --git a/src/StructType/GetListMailBoxPickingDatesResponseType.php b/src/StructType/GetListMailBoxPickingDatesResponseType.php index aa828ef..1fba299 100644 --- a/src/StructType/GetListMailBoxPickingDatesResponseType.php +++ b/src/StructType/GetListMailBoxPickingDatesResponseType.php @@ -99,7 +99,7 @@ public function setMailBoxPickingDates(array $mailBoxPickingDates = array()) throw new \InvalidArgumentException(sprintf('The mailBoxPickingDates property can only contain items of dateTime, "%s" given', is_object($getListMailBoxPickingDatesResponseTypeMailBoxPickingDatesItem) ? get_class($getListMailBoxPickingDatesResponseTypeMailBoxPickingDatesItem) : gettype($getListMailBoxPickingDatesResponseTypeMailBoxPickingDatesItem)), __LINE__); } } - if (is_null($mailBoxPickingDates)) { + if (is_null($mailBoxPickingDates) || (is_array($mailBoxPickingDates) && empty($mailBoxPickingDates))) { unset($this->mailBoxPickingDates); } else { $this->mailBoxPickingDates = $mailBoxPickingDates; diff --git a/src/StructType/GetProductInter.php b/src/StructType/GetProductInter.php index b68a9ad..2556cc0 100644 --- a/src/StructType/GetProductInter.php +++ b/src/StructType/GetProductInter.php @@ -23,8 +23,7 @@ class GetProductInter extends AbstractStructBase /** * Constructor method for getProductInter * @uses GetProductInter::setGetProductInterRequest() - * @param \ColissimoPostage\StructType\GetProductInterRequest - * $getProductInterRequest + * @param \ColissimoPostage\StructType\GetProductInterRequest $getProductInterRequest */ public function __construct(\ColissimoPostage\StructType\GetProductInterRequest $getProductInterRequest = null) { @@ -41,8 +40,7 @@ public function getGetProductInterRequest() } /** * Set getProductInterRequest value - * @param \ColissimoPostage\StructType\GetProductInterRequest - * $getProductInterRequest + * @param \ColissimoPostage\StructType\GetProductInterRequest $getProductInterRequest * @return \ColissimoPostage\StructType\GetProductInter */ public function setGetProductInterRequest(\ColissimoPostage\StructType\GetProductInterRequest $getProductInterRequest = null) diff --git a/src/StructType/GetProductInterResponseType.php b/src/StructType/GetProductInterResponseType.php index 1f0ab71..34d9274 100644 --- a/src/StructType/GetProductInterResponseType.php +++ b/src/StructType/GetProductInterResponseType.php @@ -79,7 +79,7 @@ public function setProduct(array $product = array()) throw new \InvalidArgumentException(sprintf('The product property can only contain items of string, "%s" given', is_object($getProductInterResponseTypeProductItem) ? get_class($getProductInterResponseTypeProductItem) : gettype($getProductInterResponseTypeProductItem)), __LINE__); } } - if (is_null($product)) { + if (is_null($product) || (is_array($product) && empty($product))) { unset($this->product); } else { $this->product = $product; @@ -150,7 +150,7 @@ public function setReturnTypeChoice(array $returnTypeChoice = array()) throw new \InvalidArgumentException(sprintf('The returnTypeChoice property can only contain items of string, "%s" given', is_object($getProductInterResponseTypeReturnTypeChoiceItem) ? get_class($getProductInterResponseTypeReturnTypeChoiceItem) : gettype($getProductInterResponseTypeReturnTypeChoiceItem)), __LINE__); } } - if (is_null($returnTypeChoice)) { + if (is_null($returnTypeChoice) || (is_array($returnTypeChoice) && empty($returnTypeChoice))) { unset($this->returnTypeChoice); } else { $this->returnTypeChoice = $returnTypeChoice; diff --git a/src/StructType/Original.php b/src/StructType/Original.php new file mode 100644 index 0000000..3e4938a --- /dev/null +++ b/src/StructType/Original.php @@ -0,0 +1,169 @@ + + */ +class Original extends AbstractStructBase +{ + /** + * The originalIdent + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $originalIdent; + /** + * The originalInvoiceNumber + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $originalInvoiceNumber; + /** + * The originalInvoiceDate + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $originalInvoiceDate; + /** + * The originalParcelNumber + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var string + */ + public $originalParcelNumber; + /** + * Constructor method for original + * @uses Original::setOriginalIdent() + * @uses Original::setOriginalInvoiceNumber() + * @uses Original::setOriginalInvoiceDate() + * @uses Original::setOriginalParcelNumber() + * @param string $originalIdent + * @param string $originalInvoiceNumber + * @param string $originalInvoiceDate + * @param string $originalParcelNumber + */ + public function __construct($originalIdent = null, $originalInvoiceNumber = null, $originalInvoiceDate = null, $originalParcelNumber = null) + { + $this + ->setOriginalIdent($originalIdent) + ->setOriginalInvoiceNumber($originalInvoiceNumber) + ->setOriginalInvoiceDate($originalInvoiceDate) + ->setOriginalParcelNumber($originalParcelNumber); + } + /** + * Get originalIdent value + * @return string|null + */ + public function getOriginalIdent() + { + return $this->originalIdent; + } + /** + * Set originalIdent value + * @param string $originalIdent + * @return \ColissimoPostage\StructType\Original + */ + public function setOriginalIdent($originalIdent = null) + { + // validation for constraint: string + if (!is_null($originalIdent) && !is_string($originalIdent)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originalIdent)), __LINE__); + } + $this->originalIdent = $originalIdent; + return $this; + } + /** + * Get originalInvoiceNumber value + * @return string|null + */ + public function getOriginalInvoiceNumber() + { + return $this->originalInvoiceNumber; + } + /** + * Set originalInvoiceNumber value + * @param string $originalInvoiceNumber + * @return \ColissimoPostage\StructType\Original + */ + public function setOriginalInvoiceNumber($originalInvoiceNumber = null) + { + // validation for constraint: string + if (!is_null($originalInvoiceNumber) && !is_string($originalInvoiceNumber)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originalInvoiceNumber)), __LINE__); + } + $this->originalInvoiceNumber = $originalInvoiceNumber; + return $this; + } + /** + * Get originalInvoiceDate value + * @return string|null + */ + public function getOriginalInvoiceDate() + { + return $this->originalInvoiceDate; + } + /** + * Set originalInvoiceDate value + * @param string $originalInvoiceDate + * @return \ColissimoPostage\StructType\Original + */ + public function setOriginalInvoiceDate($originalInvoiceDate = null) + { + // validation for constraint: string + if (!is_null($originalInvoiceDate) && !is_string($originalInvoiceDate)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originalInvoiceDate)), __LINE__); + } + $this->originalInvoiceDate = $originalInvoiceDate; + return $this; + } + /** + * Get originalParcelNumber value + * @return string|null + */ + public function getOriginalParcelNumber() + { + return $this->originalParcelNumber; + } + /** + * Set originalParcelNumber value + * @param string $originalParcelNumber + * @return \ColissimoPostage\StructType\Original + */ + public function setOriginalParcelNumber($originalParcelNumber = null) + { + // validation for constraint: string + if (!is_null($originalParcelNumber) && !is_string($originalParcelNumber)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($originalParcelNumber)), __LINE__); + } + $this->originalParcelNumber = $originalParcelNumber; + return $this; + } + /** + * Method called when an object has been exported with var_export() functions + * It allows to return an object instantiated with the values + * @see AbstractStructBase::__set_state() + * @uses AbstractStructBase::__set_state() + * @param array $array the exported values + * @return \ColissimoPostage\StructType\Original + */ + public static function __set_state(array $array) + { + return parent::__set_state($array); + } + /** + * Method returning the class name + * @return string __CLASS__ + */ + public function __toString() + { + return __CLASS__; + } +} diff --git a/src/StructType/OutputFormat.php b/src/StructType/OutputFormat.php index 912f95b..b760fad 100644 --- a/src/StructType/OutputFormat.php +++ b/src/StructType/OutputFormat.php @@ -46,6 +46,13 @@ class OutputFormat extends AbstractStructBase * @var string */ public $returnType; + /** + * The printCODDocument + * Meta informations extracted from the WSDL + * - minOccurs: 0 + * @var bool + */ + public $printCODDocument; /** * Constructor method for outputFormat * @uses OutputFormat::setX() @@ -53,20 +60,23 @@ class OutputFormat extends AbstractStructBase * @uses OutputFormat::setOutputPrintingType() * @uses OutputFormat::setDematerialized() * @uses OutputFormat::setReturnType() + * @uses OutputFormat::setPrintCODDocument() * @param int $x * @param int $y * @param string $outputPrintingType * @param bool $dematerialized * @param string $returnType + * @param bool $printCODDocument */ - public function __construct($x = null, $y = null, $outputPrintingType = null, $dematerialized = null, $returnType = null) + public function __construct($x = null, $y = null, $outputPrintingType = null, $dematerialized = null, $returnType = null, $printCODDocument = null) { $this ->setX($x) ->setY($y) ->setOutputPrintingType($outputPrintingType) ->setDematerialized($dematerialized) - ->setReturnType($returnType); + ->setReturnType($returnType) + ->setPrintCODDocument($printCODDocument); } /** * Get x value @@ -174,6 +184,24 @@ public function setReturnType($returnType = null) $this->returnType = $returnType; return $this; } + /** + * Get printCODDocument value + * @return bool|null + */ + public function getPrintCODDocument() + { + return $this->printCODDocument; + } + /** + * Set printCODDocument value + * @param bool $printCODDocument + * @return \ColissimoPostage\StructType\OutputFormat + */ + public function setPrintCODDocument($printCODDocument = null) + { + $this->printCODDocument = $printCODDocument; + return $this; + } /** * Method called when an object has been exported with var_export() functions * It allows to return an object instantiated with the values diff --git a/src/StructType/Routing.php b/src/StructType/Routing.php index 95dbc79..0521ed2 100644 --- a/src/StructType/Routing.php +++ b/src/StructType/Routing.php @@ -68,12 +68,12 @@ class Routing extends AbstractStructBase */ public $serviceMark; /** - * The serviceName + * The serviceText * Meta informations extracted from the WSDL * - minOccurs: 0 * @var string */ - public $serviceName; + public $serviceText; /** * The sortDest * Meta informations extracted from the WSDL @@ -98,7 +98,7 @@ class Routing extends AbstractStructBase * @uses Routing::setPartnerType() * @uses Routing::setRoutingVersion() * @uses Routing::setServiceMark() - * @uses Routing::setServiceName() + * @uses Routing::setServiceText() * @uses Routing::setSortDest() * @uses Routing::setSortOrigin() * @param string $barcodeId @@ -109,11 +109,11 @@ class Routing extends AbstractStructBase * @param string $partnerType * @param string $routingVersion * @param string $serviceMark - * @param string $serviceName + * @param string $serviceText * @param string $sortDest * @param string $sortOrigin */ - public function __construct($barcodeId = null, $depotDest = null, $destinationCountry = null, $destinationCountryText = null, $groupingPriorityLabel = null, $partnerType = null, $routingVersion = null, $serviceMark = null, $serviceName = null, $sortDest = null, $sortOrigin = null) + public function __construct($barcodeId = null, $depotDest = null, $destinationCountry = null, $destinationCountryText = null, $groupingPriorityLabel = null, $partnerType = null, $routingVersion = null, $serviceMark = null, $serviceText = null, $sortDest = null, $sortOrigin = null) { $this ->setBarcodeId($barcodeId) @@ -124,7 +124,7 @@ public function __construct($barcodeId = null, $depotDest = null, $destinationCo ->setPartnerType($partnerType) ->setRoutingVersion($routingVersion) ->setServiceMark($serviceMark) - ->setServiceName($serviceName) + ->setServiceText($serviceText) ->setSortDest($sortDest) ->setSortOrigin($sortOrigin); } @@ -305,25 +305,25 @@ public function setServiceMark($serviceMark = null) return $this; } /** - * Get serviceName value + * Get serviceText value * @return string|null */ - public function getServiceName() + public function getServiceText() { - return $this->serviceName; + return $this->serviceText; } /** - * Set serviceName value - * @param string $serviceName + * Set serviceText value + * @param string $serviceText * @return \ColissimoPostage\StructType\Routing */ - public function setServiceName($serviceName = null) + public function setServiceText($serviceText = null) { // validation for constraint: string - if (!is_null($serviceName) && !is_string($serviceName)) { - throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceName)), __LINE__); + if (!is_null($serviceText) && !is_string($serviceText)) { + throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($serviceText)), __LINE__); } - $this->serviceName = $serviceName; + $this->serviceText = $serviceText; return $this; } /** diff --git a/src/StructType/XmlResponse.php b/src/StructType/XmlResponse.php index 438a0a3..62dba63 100644 --- a/src/StructType/XmlResponse.php +++ b/src/StructType/XmlResponse.php @@ -61,6 +61,15 @@ class XmlResponse extends AbstractStructBase * @var string */ public $contractNumber; + /** + * The elementVisual + * Meta informations extracted from the WSDL + * - maxOccurs: unbounded + * - minOccurs: 0 + * - nillable: true + * @var \ColissimoPostage\StructType\ElementVisual[] + */ + public $elementVisual; /** * The numberPCH * Meta informations extracted from the WSDL @@ -133,6 +142,7 @@ class XmlResponse extends AbstractStructBase * @uses XmlResponse::setBarCodeRouting() * @uses XmlResponse::setBelgiumLabel() * @uses XmlResponse::setContractNumber() + * @uses XmlResponse::setElementVisual() * @uses XmlResponse::setNumberPCH() * @uses XmlResponse::setNumberRouting() * @uses XmlResponse::setParcelNumber() @@ -149,6 +159,7 @@ class XmlResponse extends AbstractStructBase * @param string $barCodeRouting * @param \ColissimoPostage\StructType\BelgiumLabel $belgiumLabel * @param string $contractNumber + * @param \ColissimoPostage\StructType\ElementVisual[] $elementVisual * @param string $numberPCH * @param string $numberRouting * @param string $parcelNumber @@ -159,7 +170,7 @@ class XmlResponse extends AbstractStructBase * @param \ColissimoPostage\StructType\Site $sitePCH * @param \ColissimoPostage\StructType\ZoneRouting $zoneRouting */ - public function __construct(base64Binary $cn23 = null, \ColissimoPostage\StructType\Addressee $addressee = null, $barCodeCityssimo = null, $barCodePCH = null, $barCodeRouting = null, \ColissimoPostage\StructType\BelgiumLabel $belgiumLabel = null, $contractNumber = null, $numberPCH = null, $numberRouting = null, $parcelNumber = null, $parcelNumberPartner = null, \ColissimoPostage\StructType\PickupLocation $pickupLocation = null, \ColissimoPostage\StructType\Routing $routing = null, \ColissimoPostage\StructType\Sender $sender = null, \ColissimoPostage\StructType\Site $sitePCH = null, \ColissimoPostage\StructType\ZoneRouting $zoneRouting = null) + public function __construct(base64Binary $cn23 = null, \ColissimoPostage\StructType\Addressee $addressee = null, $barCodeCityssimo = null, $barCodePCH = null, $barCodeRouting = null, \ColissimoPostage\StructType\BelgiumLabel $belgiumLabel = null, $contractNumber = null, array $elementVisual = array(), $numberPCH = null, $numberRouting = null, $parcelNumber = null, $parcelNumberPartner = null, \ColissimoPostage\StructType\PickupLocation $pickupLocation = null, \ColissimoPostage\StructType\Routing $routing = null, \ColissimoPostage\StructType\Sender $sender = null, \ColissimoPostage\StructType\Site $sitePCH = null, \ColissimoPostage\StructType\ZoneRouting $zoneRouting = null) { $this ->setCn23($cn23) @@ -169,6 +180,7 @@ public function __construct(base64Binary $cn23 = null, \ColissimoPostage\StructT ->setBarCodeRouting($barCodeRouting) ->setBelgiumLabel($belgiumLabel) ->setContractNumber($contractNumber) + ->setElementVisual($elementVisual) ->setNumberPCH($numberPCH) ->setNumberRouting($numberRouting) ->setParcelNumber($parcelNumber) @@ -321,6 +333,55 @@ public function setContractNumber($contractNumber = null) $this->contractNumber = $contractNumber; return $this; } + /** + * Get elementVisual value + * An additional test has been added (isset) before returning the property value as + * this property may have been unset before, due to the fact that this property is + * removable from the request (nillable=true+minOccurs=0) + * @return \ColissimoPostage\StructType\ElementVisual[]|null + */ + public function getElementVisual() + { + return isset($this->elementVisual) ? $this->elementVisual : null; + } + /** + * Set elementVisual value + * This property is removable from request (nillable=true+minOccurs=0), therefore + * if the value assigned to this property is null, it is removed from this object + * @throws \InvalidArgumentException + * @param \ColissimoPostage\StructType\ElementVisual[] $elementVisual + * @return \ColissimoPostage\StructType\XmlResponse + */ + public function setElementVisual(array $elementVisual = array()) + { + foreach ($elementVisual as $xmlResponseElementVisualItem) { + // validation for constraint: itemType + if (!$xmlResponseElementVisualItem instanceof \ColissimoPostage\StructType\ElementVisual) { + throw new \InvalidArgumentException(sprintf('The elementVisual property can only contain items of \ColissimoPostage\StructType\ElementVisual, "%s" given', is_object($xmlResponseElementVisualItem) ? get_class($xmlResponseElementVisualItem) : gettype($xmlResponseElementVisualItem)), __LINE__); + } + } + if (is_null($elementVisual) || (is_array($elementVisual) && empty($elementVisual))) { + unset($this->elementVisual); + } else { + $this->elementVisual = $elementVisual; + } + return $this; + } + /** + * Add item to elementVisual value + * @throws \InvalidArgumentException + * @param \ColissimoPostage\StructType\ElementVisual $item + * @return \ColissimoPostage\StructType\XmlResponse + */ + public function addToElementVisual(\ColissimoPostage\StructType\ElementVisual $item) + { + // validation for constraint: itemType + if (!$item instanceof \ColissimoPostage\StructType\ElementVisual) { + throw new \InvalidArgumentException(sprintf('The elementVisual property can only contain items of \ColissimoPostage\StructType\ElementVisual, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__); + } + $this->elementVisual[] = $item; + return $this; + } /** * Get numberPCH value * @return string|null From 21fec24d0c4eeb9454968711d435f83c24c56333 Mon Sep 17 00:00:00 2001 From: Mikael DELSOL Date: Mon, 11 Apr 2016 22:44:01 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2faa21..e389c41 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # CHANGELOG +## 0.0.2 +- Update generated classes using latest generator version, fixes broken code on parameter value test, fixes autocompletion + ## 0.0.1 - Initial version