<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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