<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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