<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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