<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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