<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Ticketing.GaAreaHistory StructType
 * @subpackage Structs
 */
class Ticketing_GaAreaHistory extends Ticketing_HallHistory
{
    /**
     * The NewNameValue
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\GlobalString
     */
    public $NewNameValue;
    /**
     * The OldNameValue
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\GlobalString
     */
    public $OldNameValue;
    /**
     * The UserName
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $UserName;
    /**
     * Constructor method for Ticketing.GaAreaHistory
     * @uses Ticketing_GaAreaHistory::setNewNameValue()
     * @uses Ticketing_GaAreaHistory::setOldNameValue()
     * @uses Ticketing_GaAreaHistory::setUserName()
     * @param \patest\StructType\GlobalString $newNameValue
     * @param \patest\StructType\GlobalString $oldNameValue
     * @param string $userName
     */
    public function __construct(\patest\StructType\GlobalString $newNameValue = null, \patest\StructType\GlobalString $oldNameValue = null, $userName = null)
    {
        $this
            ->setNewNameValue($newNameValue)
            ->setOldNameValue($oldNameValue)
            ->setUserName($userName);
    }
    /**
     * Get NewNameValue 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 \patest\StructType\GlobalString|null
     */
    public function getNewNameValue()
    {
        return isset($this->NewNameValue) ? $this->NewNameValue : null;
    }
    /**
     * Set NewNameValue 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 \patest\StructType\GlobalString $newNameValue
     * @return \patest\StructType\Ticketing_GaAreaHistory
     */
    public function setNewNameValue(\patest\StructType\GlobalString $newNameValue = null)
    {
        if (is_null($newNameValue) || (is_array($newNameValue) && empty($newNameValue))) {
            unset($this->NewNameValue);
        } else {
            $this->NewNameValue = $newNameValue;
        }
        return $this;
    }
    /**
     * Get OldNameValue 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 \patest\StructType\GlobalString|null
     */
    public function getOldNameValue()
    {
        return isset($this->OldNameValue) ? $this->OldNameValue : null;
    }
    /**
     * Set OldNameValue 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 \patest\StructType\GlobalString $oldNameValue
     * @return \patest\StructType\Ticketing_GaAreaHistory
     */
    public function setOldNameValue(\patest\StructType\GlobalString $oldNameValue = null)
    {
        if (is_null($oldNameValue) || (is_array($oldNameValue) && empty($oldNameValue))) {
            unset($this->OldNameValue);
        } else {
            $this->OldNameValue = $oldNameValue;
        }
        return $this;
    }
    /**
     * Get UserName 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 string|null
     */
    public function getUserName()
    {
        return isset($this->UserName) ? $this->UserName : null;
    }
    /**
     * Set UserName 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 string $userName
     * @return \patest\StructType\Ticketing_GaAreaHistory
     */
    public function setUserName($userName = null)
    {
        // validation for constraint: string
        if (!is_null($userName) && !is_string($userName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($userName, true), gettype($userName)), __LINE__);
        }
        if (is_null($userName) || (is_array($userName) && empty($userName))) {
            unset($this->UserName);
        } else {
            $this->UserName = $userName;
        }
        return $this;
    }
}
