<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for softKeys StructType
 * Meta informations extracted from the WSDL
 * - documentation: List of mandatory keys for each callstate ::On Hook - NewCallConnected - End CallOn Hold - ResumeOff Hook - End CallConnected Transfer - TransferDigits After First - BackwardConnected Conference - ConferenceRing Out - End CallOff
 * Hook With Feature - End Call | List of mandatory keys for each callstate ::On Hook - NewCallConnected - End CallOn Hold - ResumeOff Hook - End CallConnected Transfer - TransferDigits After First - BackwardConnected Conference - ConferenceRing Out -
 * End CallOff Hook With Feature - End Call
 * @subpackage Structs
 */
class SoftKeys extends AbstractStructBase
{
    /**
     * The softKey
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XSoftKeyMember[]
     */
    public $softKey;
    /**
     * Constructor method for softKeys
     * @uses SoftKeys::setSoftKey()
     * @param XSoftKeyMember[] $softKey
     */
    public function __construct(array $softKey = array())
    {
        $this
            ->setSoftKey($softKey);
    }
    /**
     * Get softKey value
     * @return XSoftKeyMember[]|null
     */
    public function getSoftKey()
    {
        return $this->softKey;
    }
    /**
     * Set softKey value
     * @throws \InvalidArgumentException
     * @param XSoftKeyMember[] $softKey
     * @return SoftKeys
     */
    public function setSoftKey(array $softKey = array())
    {
        foreach ($softKey as $softKeysSoftKeyItem) {
            // validation for constraint: itemType
            if (!$softKeysSoftKeyItem instanceof XSoftKeyMember) {
                throw new \InvalidArgumentException(sprintf('The softKey property can only contain items of XSoftKeyMember, "%s" given', is_object($softKeysSoftKeyItem) ? get_class($softKeysSoftKeyItem) : gettype($softKeysSoftKeyItem)), __LINE__);
            }
        }
        $this->softKey = $softKey;
        return $this;
    }
    /**
     * Add item to softKey value
     * @throws \InvalidArgumentException
     * @param XSoftKeyMember $item
     * @return SoftKeys
     */
    public function addToSoftKey(XSoftKeyMember $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XSoftKeyMember) {
            throw new \InvalidArgumentException(sprintf('The softKey property can only contain items of XSoftKeyMember, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->softKey[] = $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 SoftKeys
     */
    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__;
    }
}
