<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for busyLampFields StructType
 * @subpackage Structs
 */
class BusyLampFields extends AbstractStructBase
{
    /**
     * The busyLampField
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XBusyLampField[]
     */
    public $busyLampField;
    /**
     * Constructor method for busyLampFields
     * @uses BusyLampFields::setBusyLampField()
     * @param XBusyLampField[] $busyLampField
     */
    public function __construct(array $busyLampField = array())
    {
        $this
            ->setBusyLampField($busyLampField);
    }
    /**
     * Get busyLampField value
     * @return XBusyLampField[]|null
     */
    public function getBusyLampField()
    {
        return $this->busyLampField;
    }
    /**
     * Set busyLampField value
     * @throws \InvalidArgumentException
     * @param XBusyLampField[] $busyLampField
     * @return BusyLampFields
     */
    public function setBusyLampField(array $busyLampField = array())
    {
        foreach ($busyLampField as $busyLampFieldsBusyLampFieldItem) {
            // validation for constraint: itemType
            if (!$busyLampFieldsBusyLampFieldItem instanceof XBusyLampField) {
                throw new \InvalidArgumentException(sprintf('The busyLampField property can only contain items of XBusyLampField, "%s" given', is_object($busyLampFieldsBusyLampFieldItem) ? get_class($busyLampFieldsBusyLampFieldItem) : gettype($busyLampFieldsBusyLampFieldItem)), __LINE__);
            }
        }
        $this->busyLampField = $busyLampField;
        return $this;
    }
    /**
     * Add item to busyLampField value
     * @throws \InvalidArgumentException
     * @param XBusyLampField $item
     * @return BusyLampFields
     */
    public function addToBusyLampField(XBusyLampField $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XBusyLampField) {
            throw new \InvalidArgumentException(sprintf('The busyLampField property can only contain items of XBusyLampField, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->busyLampField[] = $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 BusyLampFields
     */
    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__;
    }
}
