<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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