<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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