<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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