<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XMobileVoiceAccess StructType
 * @subpackage Structs
 */
class XMobileVoiceAccess extends AbstractStructBase
{
    /**
     * The pattern
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * @var string
     */
    public $pattern;
    /**
     * The locales
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var Locales
     */
    public $locales;
    /**
     * The routePartitionName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * @var XFkType
     */
    public $routePartitionName;
    /**
     * Constructor method for XMobileVoiceAccess
     * @uses XMobileVoiceAccess::setPattern()
     * @uses XMobileVoiceAccess::setLocales()
     * @uses XMobileVoiceAccess::setRoutePartitionName()
     * @param string $pattern
     * @param Locales $locales
     * @param XFkType $routePartitionName
     */
    public function __construct($pattern = null, Locales $locales = null, XFkType $routePartitionName = null)
    {
        $this
            ->setPattern($pattern)
            ->setLocales($locales)
            ->setRoutePartitionName($routePartitionName);
    }
    /**
     * Get pattern value
     * @return string
     */
    public function getPattern()
    {
        return $this->pattern;
    }
    /**
     * Set pattern value
     * @param string $pattern
     * @return XMobileVoiceAccess
     */
    public function setPattern($pattern = null)
    {
        // validation for constraint: string
        if (!is_null($pattern) && !is_string($pattern)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pattern)), __LINE__);
        }
        $this->pattern = $pattern;
        return $this;
    }
    /**
     * Get locales value
     * @return Locales
     */
    public function getLocales()
    {
        return $this->locales;
    }
    /**
     * Set locales value
     * @param Locales $locales
     * @return XMobileVoiceAccess
     */
    public function setLocales(Locales $locales = null)
    {
        $this->locales = $locales;
        return $this;
    }
    /**
     * Get routePartitionName value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return XFkType|null
     */
    public function getRoutePartitionName()
    {
        return isset($this->routePartitionName) ? $this->routePartitionName : null;
    }
    /**
     * Set routePartitionName value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param XFkType $routePartitionName
     * @return XMobileVoiceAccess
     */
    public function setRoutePartitionName(XFkType $routePartitionName = null)
    {
        if (is_null($routePartitionName) || (is_array($routePartitionName) && empty($routePartitionName))) {
            unset($this->routePartitionName);
        } else {
            $this->routePartitionName = $routePartitionName;
        }
        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 XMobileVoiceAccess
     */
    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__;
    }
}
