<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SituationExchangeDeliveriesStructure StructType
 * Meta informations extracted from the WSDL
 * - documentation: Type for Deliveries for Situation Exchange Service. Used in WSDL. | Delivery for Vehicle Activity Service.
 * @subpackage Structs
 */
class SituationExchangeDeliveriesStructure extends AbstractStructBase
{
    /**
     * The SituationExchangeDelivery
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - ref: SituationExchangeDelivery
     * @var \StructType\SituationExchangeDeliveryStructure[]
     */
    public $SituationExchangeDelivery;
    /**
     * Constructor method for SituationExchangeDeliveriesStructure
     * @uses SituationExchangeDeliveriesStructure::setSituationExchangeDelivery()
     * @param \StructType\SituationExchangeDeliveryStructure[] $situationExchangeDelivery
     */
    public function __construct(array $situationExchangeDelivery = array())
    {
        $this
            ->setSituationExchangeDelivery($situationExchangeDelivery);
    }
    /**
     * Get SituationExchangeDelivery value
     * @return \StructType\SituationExchangeDeliveryStructure[]|null
     */
    public function getSituationExchangeDelivery()
    {
        return $this->SituationExchangeDelivery;
    }
    /**
     * Set SituationExchangeDelivery value
     * @throws \InvalidArgumentException
     * @param \StructType\SituationExchangeDeliveryStructure[] $situationExchangeDelivery
     * @return \StructType\SituationExchangeDeliveriesStructure
     */
    public function setSituationExchangeDelivery(array $situationExchangeDelivery = array())
    {
        foreach ($situationExchangeDelivery as $situationExchangeDeliveriesStructureSituationExchangeDeliveryItem) {
            // validation for constraint: itemType
            if (!$situationExchangeDeliveriesStructureSituationExchangeDeliveryItem instanceof \StructType\SituationExchangeDeliveryStructure) {
                throw new \InvalidArgumentException(sprintf('The SituationExchangeDelivery property can only contain items of \StructType\SituationExchangeDeliveryStructure, "%s" given', is_object($situationExchangeDeliveriesStructureSituationExchangeDeliveryItem) ? get_class($situationExchangeDeliveriesStructureSituationExchangeDeliveryItem) : gettype($situationExchangeDeliveriesStructureSituationExchangeDeliveryItem)), __LINE__);
            }
        }
        $this->SituationExchangeDelivery = $situationExchangeDelivery;
        return $this;
    }
    /**
     * Add item to SituationExchangeDelivery value
     * @throws \InvalidArgumentException
     * @param \StructType\SituationExchangeDeliveryStructure $item
     * @return \StructType\SituationExchangeDeliveriesStructure
     */
    public function addToSituationExchangeDelivery(\StructType\SituationExchangeDeliveryStructure $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SituationExchangeDeliveryStructure) {
            throw new \InvalidArgumentException(sprintf('The SituationExchangeDelivery property can only contain items of \StructType\SituationExchangeDeliveryStructure, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->SituationExchangeDelivery[] = $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
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \StructType\SituationExchangeDeliveriesStructure
     */
    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__;
    }
}
