xxxxxxxxxx
use \WsdlToPhp\PackageBase\AbstractStructBase;
/**
* This class stands for getAddressLabelResponse StructType
* @subpackage Structs
*/
class GetAddressLabelResponse extends AbstractStructBase
{
/**
* The content
* Meta information extracted from the WSDL
* - maxOccurs: unbounded
* - minOccurs: 0
* @var AddressLabelContent[]
*/
public $content;
/**
* The error
* Meta information extracted from the WSDL
* - maxOccurs: unbounded
* - minOccurs: 0
* @var ErrorType[]
*/
public $error;
/**
* Constructor method for getAddressLabelResponse
* @uses GetAddressLabelResponse::setContent()
* @uses GetAddressLabelResponse::setError()
* @param AddressLabelContent[] $content
* @param ErrorType[] $error
*/
public function __construct(array $content = array(), array $error = array())
{
$this
->setContent($content)
->setError($error);
}
/**
* Get content value
* @return AddressLabelContent[]|null
*/
public function getContent()
{
return $this->content;
}
/**
* This method is responsible for validating the values passed to the setContent method
* This method is willingly generated in order to preserve the one-line inline validation within the setContent method
* @param array $values
* @return string A non-empty message if the values does not match the validation rules
*/
public static function validateContentForArrayConstraintsFromSetContent(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $getAddressLabelResponseContentItem) {
// validation for constraint: itemType
if (!$getAddressLabelResponseContentItem instanceof AddressLabelContent) {
$invalidValues[] = is_object($getAddressLabelResponseContentItem) ? get_class($getAddressLabelResponseContentItem) : sprintf('%s(%s)', gettype($getAddressLabelResponseContentItem), var_export($getAddressLabelResponseContentItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The content property can only contain items of type AddressLabelContent, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
}
/**
* Set content value
* @throws \InvalidArgumentException
* @param AddressLabelContent[] $content
* @return GetAddressLabelResponse
*/
public function setContent(array $content = array())
{
// validation for constraint: array
if ('' !== ($contentArrayErrorMessage = self::validateContentForArrayConstraintsFromSetContent($content))) {
throw new \InvalidArgumentException($contentArrayErrorMessage, __LINE__);
}
$this->content = $content;
return $this;
}
/**
* Add item to content value
* @throws \InvalidArgumentException
* @param AddressLabelContent $item
* @return GetAddressLabelResponse
*/
public function addToContent(AddressLabelContent $item)
{
// validation for constraint: itemType
if (!$item instanceof AddressLabelContent) {
throw new \InvalidArgumentException(sprintf('The content property can only contain items of type AddressLabelContent, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->content[] = $item;
return $this;
}
/**
* Get error value
* @return ErrorType[]|null
*/
public function getError()
{
return $this->error;
}
/**
* This method is responsible for validating the values passed to the setError method
* This method is willingly generated in order to preserve the one-line inline validation within the setError method
* @param array $values
* @return string A non-empty message if the values does not match the validation rules
*/
public static function validateErrorForArrayConstraintsFromSetError(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $getAddressLabelResponseErrorItem) {
// validation for constraint: itemType
if (!$getAddressLabelResponseErrorItem instanceof ErrorType) {
$invalidValues[] = is_object($getAddressLabelResponseErrorItem) ? get_class($getAddressLabelResponseErrorItem) : sprintf('%s(%s)', gettype($getAddressLabelResponseErrorItem), var_export($getAddressLabelResponseErrorItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The error property can only contain items of type ErrorType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
}
/**
* Set error value
* @throws \InvalidArgumentException
* @param ErrorType[] $error
* @return GetAddressLabelResponse
*/
public function setError(array $error = array())
{
// validation for constraint: array
if ('' !== ($errorArrayErrorMessage = self::validateErrorForArrayConstraintsFromSetError($error))) {
throw new \InvalidArgumentException($errorArrayErrorMessage, __LINE__);
}
$this->error = $error;
return $this;
}
/**
* Add item to error value
* @throws \InvalidArgumentException
* @param ErrorType $item
* @return GetAddressLabelResponse
*/
public function addToError(ErrorType $item)
{
// validation for constraint: itemType
if (!$item instanceof ErrorType) {
throw new \InvalidArgumentException(sprintf('The error property can only contain items of type ErrorType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->error[] = $item;
return $this;
}
}
Don't be shy, don't hesitate to contact us for any subject, we'll be glad to help.
This platform is provided to give developpers and non developpers a way to easily consume SOAP Web Services or share their own SOAP Web Services with extra features powered by the platform.
© 2025 Providr.IO