<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 addShipment StructType
 * @subpackage Structs
 */
class AddShipment extends AbstractStructBase
{
    /**
     * The przesylki
     * Meta information extracted from the WSDL
     * - maxOccurs: 500
     * - minOccurs: 1
     * @var PrzesylkaType[]
     */
    public $przesylki;
    /**
     * The idBufor
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var int
     */
    public $idBufor;
    /**
     * Constructor method for addShipment
     * @uses AddShipment::setPrzesylki()
     * @uses AddShipment::setIdBufor()
     * @param PrzesylkaType[] $przesylki
     * @param int $idBufor
     */
    public function __construct(array $przesylki = array(), $idBufor = null)
    {
        $this
            -&gt;setPrzesylki($przesylki)
            -&gt;setIdBufor($idBufor);
    }
    /**
     * Get przesylki value
     * @return PrzesylkaType[]
     */
    public function getPrzesylki()
    {
        return $this-&gt;przesylki;
    }
    /**
     * This method is responsible for validating the values passed to the setPrzesylki method
     * This method is willingly generated in order to preserve the one-line inline validation within the setPrzesylki method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validatePrzesylkiForArrayConstraintsFromSetPrzesylki(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $addShipmentPrzesylkiItem) {
            // validation for constraint: itemType
            if (!$addShipmentPrzesylkiItem instanceof PrzesylkaType) {
                $invalidValues[] = is_object($addShipmentPrzesylkiItem) ? get_class($addShipmentPrzesylkiItem) : sprintf('%s(%s)', gettype($addShipmentPrzesylkiItem), var_export($addShipmentPrzesylkiItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The przesylki property can only contain items of type PrzesylkaType, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set przesylki value
     * @throws \InvalidArgumentException
     * @param PrzesylkaType[] $przesylki
     * @return AddShipment
     */
    public function setPrzesylki(array $przesylki = array())
    {
        // validation for constraint: array
        if ('' !== ($przesylkiArrayErrorMessage = self::validatePrzesylkiForArrayConstraintsFromSetPrzesylki($przesylki))) {
            throw new \InvalidArgumentException($przesylkiArrayErrorMessage, __LINE__);
        }
        // validation for constraint: maxOccurs(500)
        if (is_array($przesylki) &amp;&amp; count($przesylki) &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($przesylki)), __LINE__);
        }
        $this-&gt;przesylki = $przesylki;
        return $this;
    }
    /**
     * Add item to przesylki value
     * @throws \InvalidArgumentException
     * @param PrzesylkaType $item
     * @return AddShipment
     */
    public function addToPrzesylki(PrzesylkaType $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof PrzesylkaType) {
            throw new \InvalidArgumentException(sprintf('The przesylki property can only contain items of type PrzesylkaType, %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;przesylki) &amp;&amp; count($this-&gt;przesylki) &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;przesylki)), __LINE__);
        }
        $this-&gt;przesylki[] = $item;
        return $this;
    }
    /**
     * Get idBufor value
     * @return int|null
     */
    public function getIdBufor()
    {
        return $this-&gt;idBufor;
    }
    /**
     * Set idBufor value
     * @param int $idBufor
     * @return AddShipment
     */
    public function setIdBufor($idBufor = null)
    {
        // validation for constraint: int
        if (!is_null($idBufor) &amp;&amp; !(is_int($idBufor) || ctype_digit($idBufor))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($idBufor, true), gettype($idBufor)), __LINE__);
        }
        $this-&gt;idBufor = $idBufor;
        return $this;
    }
}
</pre></body></html>