<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SituationExchangePermissions StructType
 * Meta informations extracted from the WSDL
 * - documentation: Participant's permissions to use the service.
 * @subpackage Structs
 */
class SituationExchangePermissions extends PermissionsStructure
{
    /**
     * The SituationExchangePermission
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \StructType\SituationExchangeServicePermissionStructure[]
     */
    public $SituationExchangePermission;
    /**
     * Constructor method for SituationExchangePermissions
     * @uses SituationExchangePermissions::setSituationExchangePermission()
     * @param \StructType\SituationExchangeServicePermissionStructure[] $situationExchangePermission
     */
    public function __construct(array $situationExchangePermission = array())
    {
        $this
            ->setSituationExchangePermission($situationExchangePermission);
    }
    /**
     * Get SituationExchangePermission value
     * @return \StructType\SituationExchangeServicePermissionStructure[]|null
     */
    public function getSituationExchangePermission()
    {
        return $this->SituationExchangePermission;
    }
    /**
     * Set SituationExchangePermission value
     * @throws \InvalidArgumentException
     * @param \StructType\SituationExchangeServicePermissionStructure[] $situationExchangePermission
     * @return \StructType\SituationExchangePermissions
     */
    public function setSituationExchangePermission(array $situationExchangePermission = array())
    {
        foreach ($situationExchangePermission as $situationExchangePermissionsSituationExchangePermissionItem) {
            // validation for constraint: itemType
            if (!$situationExchangePermissionsSituationExchangePermissionItem instanceof \StructType\SituationExchangeServicePermissionStructure) {
                throw new \InvalidArgumentException(sprintf('The SituationExchangePermission property can only contain items of \StructType\SituationExchangeServicePermissionStructure, "%s" given', is_object($situationExchangePermissionsSituationExchangePermissionItem) ? get_class($situationExchangePermissionsSituationExchangePermissionItem) : gettype($situationExchangePermissionsSituationExchangePermissionItem)), __LINE__);
            }
        }
        $this->SituationExchangePermission = $situationExchangePermission;
        return $this;
    }
    /**
     * Add item to SituationExchangePermission value
     * @throws \InvalidArgumentException
     * @param \StructType\SituationExchangeServicePermissionStructure $item
     * @return \StructType\SituationExchangePermissions
     */
    public function addToSituationExchangePermission(\StructType\SituationExchangeServicePermissionStructure $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \StructType\SituationExchangeServicePermissionStructure) {
            throw new \InvalidArgumentException(sprintf('The SituationExchangePermission property can only contain items of \StructType\SituationExchangeServicePermissionStructure, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->SituationExchangePermission[] = $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 \StructType\SituationExchangePermissions
     */
    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__;
    }
}
