<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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