<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for VehicleMonitoringDeliveriesStructure StructType
 * Meta informations extracted from the WSDL
 * - documentation: Type for Deliveries for VEHICLE monitoring services Used in WSDL. | Delivery for Vehicle Moniroting Service.
 * @subpackage Structs
 */
class VehicleMonitoringDeliveriesStructure extends AbstractStructBase
{
    /**
     * The VehicleMonitoringDelivery
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - ref: VehicleMonitoringDelivery
     * @var \StructType\VehicleMonitoringDeliveryStructure[]
     */
    public $VehicleMonitoringDelivery;
    /**
     * Constructor method for VehicleMonitoringDeliveriesStructure
     * @uses VehicleMonitoringDeliveriesStructure::setVehicleMonitoringDelivery()
     * @param \StructType\VehicleMonitoringDeliveryStructure[] $vehicleMonitoringDelivery
     */
    public function __construct(array $vehicleMonitoringDelivery = array())
    {
        $this
            ->setVehicleMonitoringDelivery($vehicleMonitoringDelivery);
    }
    /**
     * Get VehicleMonitoringDelivery value
     * @return \StructType\VehicleMonitoringDeliveryStructure[]|null
     */
    public function getVehicleMonitoringDelivery()
    {
        return $this->VehicleMonitoringDelivery;
    }
    /**
     * Set VehicleMonitoringDelivery value
     * @throws \InvalidArgumentException
     * @param \StructType\VehicleMonitoringDeliveryStructure[] $vehicleMonitoringDelivery
     * @return \StructType\VehicleMonitoringDeliveriesStructure
     */
    public function setVehicleMonitoringDelivery(array $vehicleMonitoringDelivery = array())
    {
        foreach ($vehicleMonitoringDelivery as $vehicleMonitoringDeliveriesStructureVehicleMonitoringDeliveryItem) {
            // validation for constraint: itemType
            if (!$vehicleMonitoringDeliveriesStructureVehicleMonitoringDeliveryItem instanceof \StructType\VehicleMonitoringDeliveryStructure) {
                throw new \InvalidArgumentException(sprintf('The VehicleMonitoringDelivery property can only contain items of \StructType\VehicleMonitoringDeliveryStructure, "%s" given', is_object($vehicleMonitoringDeliveriesStructureVehicleMonitoringDeliveryItem) ? get_class($vehicleMonitoringDeliveriesStructureVehicleMonitoringDeliveryItem) : gettype($vehicleMonitoringDeliveriesStructureVehicleMonitoringDeliveryItem)), __LINE__);
            }
        }
        $this->VehicleMonitoringDelivery = $vehicleMonitoringDelivery;
        return $this;
    }
    /**
     * Add item to VehicleMonitoringDelivery value
     * @throws \InvalidArgumentException
     * @param \StructType\VehicleMonitoringDeliveryStructure $item
     * @return \StructType\VehicleMonitoringDeliveriesStructure
     */
    public function addToVehicleMonitoringDelivery(\StructType\VehicleMonitoringDeliveryStructure $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\VehicleMonitoringDeliveryStructure) {
            throw new \InvalidArgumentException(sprintf('The VehicleMonitoringDelivery property can only contain items of \StructType\VehicleMonitoringDeliveryStructure, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->VehicleMonitoringDelivery[] = $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\VehicleMonitoringDeliveriesStructure
     */
    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__;
    }
}
