<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">&lt;?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for addReklamacjeResponse StructType
 * @subpackage Structs
 */
class AddReklamacjeResponse extends AbstractStructBase
{
    /**
     * The error
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var ErrorType[]
     */
    public $error;
    /**
     * The reklamacjaInfo
     * Meta information extracted from the WSDL
     * - maxOccurs: 500
     * - minOccurs: 0
     * @var ReklamacjaInfoType[]
     */
    public $reklamacjaInfo;
    /**
     * Constructor method for addReklamacjeResponse
     * @uses AddReklamacjeResponse::setError()
     * @uses AddReklamacjeResponse::setReklamacjaInfo()
     * @param ErrorType[] $error
     * @param ReklamacjaInfoType[] $reklamacjaInfo
     */
    public function __construct(array $error = array(), array $reklamacjaInfo = array())
    {
        $this
            -&gt;setError($error)
            -&gt;setReklamacjaInfo($reklamacjaInfo);
    }
    /**
     * Get error value
     * @return ErrorType[]|null
     */
    public function getError()
    {
        return $this-&gt;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 $addReklamacjeResponseErrorItem) {
            // validation for constraint: itemType
            if (!$addReklamacjeResponseErrorItem instanceof ErrorType) {
                $invalidValues[] = is_object($addReklamacjeResponseErrorItem) ? get_class($addReklamacjeResponseErrorItem) : sprintf('%s(%s)', gettype($addReklamacjeResponseErrorItem), var_export($addReklamacjeResponseErrorItem, 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 AddReklamacjeResponse
     */
    public function setError(array $error = array())
    {
        // validation for constraint: array
        if ('' !== ($errorArrayErrorMessage = self::validateErrorForArrayConstraintsFromSetError($error))) {
            throw new \InvalidArgumentException($errorArrayErrorMessage, __LINE__);
        }
        $this-&gt;error = $error;
        return $this;
    }
    /**
     * Add item to error value
     * @throws \InvalidArgumentException
     * @param ErrorType $item
     * @return AddReklamacjeResponse
     */
    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-&gt;error[] = $item;
        return $this;
    }
    /**
     * Get reklamacjaInfo value
     * @return ReklamacjaInfoType[]|null
     */
    public function getReklamacjaInfo()
    {
        return $this-&gt;reklamacjaInfo;
    }
    /**
     * This method is responsible for validating the values passed to the setReklamacjaInfo method
     * This method is willingly generated in order to preserve the one-line inline validation within the setReklamacjaInfo method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateReklamacjaInfoForArrayConstraintsFromSetReklamacjaInfo(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $addReklamacjeResponseReklamacjaInfoItem) {
            // validation for constraint: itemType
            if (!$addReklamacjeResponseReklamacjaInfoItem instanceof ReklamacjaInfoType) {
                $invalidValues[] = is_object($addReklamacjeResponseReklamacjaInfoItem) ? get_class($addReklamacjeResponseReklamacjaInfoItem) : sprintf('%s(%s)', gettype($addReklamacjeResponseReklamacjaInfoItem), var_export($addReklamacjeResponseReklamacjaInfoItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The reklamacjaInfo property can only contain items of type ReklamacjaInfoType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set reklamacjaInfo value
     * @throws \InvalidArgumentException
     * @param ReklamacjaInfoType[] $reklamacjaInfo
     * @return AddReklamacjeResponse
     */
    public function setReklamacjaInfo(array $reklamacjaInfo = array())
    {
        // validation for constraint: array
        if ('' !== ($reklamacjaInfoArrayErrorMessage = self::validateReklamacjaInfoForArrayConstraintsFromSetReklamacjaInfo($reklamacjaInfo))) {
            throw new \InvalidArgumentException($reklamacjaInfoArrayErrorMessage, __LINE__);
        }
        // validation for constraint: maxOccurs(500)
        if (is_array($reklamacjaInfo) &amp;&amp; count($reklamacjaInfo) &gt; 500) {
            throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 500', count($reklamacjaInfo)), __LINE__);
        }
        $this-&gt;reklamacjaInfo = $reklamacjaInfo;
        return $this;
    }
    /**
     * Add item to reklamacjaInfo value
     * @throws \InvalidArgumentException
     * @param ReklamacjaInfoType $item
     * @return AddReklamacjeResponse
     */
    public function addToReklamacjaInfo(ReklamacjaInfoType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof ReklamacjaInfoType) {
            throw new \InvalidArgumentException(sprintf('The reklamacjaInfo property can only contain items of type ReklamacjaInfoType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        // validation for constraint: maxOccurs(500)
        if (is_array($this-&gt;reklamacjaInfo) &amp;&amp; count($this-&gt;reklamacjaInfo) &gt;= 500) {
            throw new \InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 500', count($this-&gt;reklamacjaInfo)), __LINE__);
        }
        $this-&gt;reklamacjaInfo[] = $item;
        return $this;
    }
}
</pre></body></html>