xxxxxxxxxx
use \WsdlToPhp\PackageBase\AbstractStructBase;
/**
* This class stands for getKartyResponse StructType
* @subpackage Structs
*/
class GetKartyResponse extends AbstractStructBase
{
/**
* The karta
* Meta information extracted from the WSDL
* - maxOccurs: unbounded
* - minOccurs: 0
* @var KartaType[]
*/
public $karta;
/**
* The error
* Meta information extracted from the WSDL
* - maxOccurs: unbounded
* - minOccurs: 0
* @var ErrorType[]
*/
public $error;
/**
* Constructor method for getKartyResponse
* @uses GetKartyResponse::setKarta()
* @uses GetKartyResponse::setError()
* @param KartaType[] $karta
* @param ErrorType[] $error
*/
public function __construct(array $karta = array(), array $error = array())
{
$this
->setKarta($karta)
->setError($error);
}
/**
* Get karta value
* @return KartaType[]|null
*/
public function getKarta()
{
return $this->karta;
}
/**
* This method is responsible for validating the values passed to the setKarta method
* This method is willingly generated in order to preserve the one-line inline validation within the setKarta method
* @param array $values
* @return string A non-empty message if the values does not match the validation rules
*/
public static function validateKartaForArrayConstraintsFromSetKarta(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $getKartyResponseKartaItem) {
// validation for constraint: itemType
if (!$getKartyResponseKartaItem instanceof KartaType) {
$invalidValues[] = is_object($getKartyResponseKartaItem) ? get_class($getKartyResponseKartaItem) : sprintf('%s(%s)', gettype($getKartyResponseKartaItem), var_export($getKartyResponseKartaItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The karta property can only contain items of type KartaType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
}
/**
* Set karta value
* @throws \InvalidArgumentException
* @param KartaType[] $karta
* @return GetKartyResponse
*/
public function setKarta(array $karta = array())
{
// validation for constraint: array
if ('' !== ($kartaArrayErrorMessage = self::validateKartaForArrayConstraintsFromSetKarta($karta))) {
throw new \InvalidArgumentException($kartaArrayErrorMessage, __LINE__);
}
$this->karta = $karta;
return $this;
}
/**
* Add item to karta value
* @throws \InvalidArgumentException
* @param KartaType $item
* @return GetKartyResponse
*/
public function addToKarta(KartaType $item)
{
// validation for constraint: itemType
if (!$item instanceof KartaType) {
throw new \InvalidArgumentException(sprintf('The karta property can only contain items of type KartaType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->karta[] = $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 $getKartyResponseErrorItem) {
// validation for constraint: itemType
if (!$getKartyResponseErrorItem instanceof ErrorType) {
$invalidValues[] = is_object($getKartyResponseErrorItem) ? get_class($getKartyResponseErrorItem) : sprintf('%s(%s)', gettype($getKartyResponseErrorItem), var_export($getKartyResponseErrorItem, 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 GetKartyResponse
*/
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 GetKartyResponse
*/
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