<?php

namespace OXModule\StructClass;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for changeModuleAccessByName StructClass
 * @subpackage Structs
 */
class ChangeModuleAccessByName extends AbstractStructBase
{
    /**
     * The ctx
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \OXModule\StructClass\Context
     */
    public $ctx;
    /**
     * The access_combination_name
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $access_combination_name;
    /**
     * The auth
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \OXModule\StructClass\Credentials
     */
    public $auth;
    /**
     * Constructor method for changeModuleAccessByName
     * @uses ChangeModuleAccessByName::setCtx()
     * @uses ChangeModuleAccessByName::setAccess_combination_name()
     * @uses ChangeModuleAccessByName::setAuth()
     * @param \OXModule\StructClass\Context $ctx
     * @param string $access_combination_name
     * @param \OXModule\StructClass\Credentials $auth
     */
    public function __construct(\OXModule\StructClass\Context $ctx = null, $access_combination_name = null, \OXModule\StructClass\Credentials $auth = null)
    {
        $this
            ->setCtx($ctx)
            ->setAccess_combination_name($access_combination_name)
            ->setAuth($auth);
    }
    /**
     * Get ctx 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 \OXModule\StructClass\Context|null
     */
    public function getCtx()
    {
        return isset($this->ctx) ? $this->ctx : null;
    }
    /**
     * Set ctx 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 \OXModule\StructClass\Context $ctx
     * @return \OXModule\StructClass\ChangeModuleAccessByName
     */
    public function setCtx(\OXModule\StructClass\Context $ctx = null)
    {
        if (is_null($ctx) || (is_array($ctx) && empty($ctx))) {
            unset($this->ctx);
        } else {
            $this->ctx = $ctx;
        }
        return $this;
    }
    /**
     * Get access_combination_name 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 getAccess_combination_name()
    {
        return isset($this->access_combination_name) ? $this->access_combination_name : null;
    }
    /**
     * Set access_combination_name 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 $access_combination_name
     * @return \OXModule\StructClass\ChangeModuleAccessByName
     */
    public function setAccess_combination_name($access_combination_name = null)
    {
        // validation for constraint: string
        if (!is_null($access_combination_name) && !is_string($access_combination_name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($access_combination_name)), __LINE__);
        }
        if (is_null($access_combination_name) || (is_array($access_combination_name) && empty($access_combination_name))) {
            unset($this->access_combination_name);
        } else {
            $this->access_combination_name = $access_combination_name;
        }
        return $this;
    }
    /**
     * Get auth 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 \OXModule\StructClass\Credentials|null
     */
    public function getAuth()
    {
        return isset($this->auth) ? $this->auth : null;
    }
    /**
     * Set auth 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 \OXModule\StructClass\Credentials $auth
     * @return \OXModule\StructClass\ChangeModuleAccessByName
     */
    public function setAuth(\OXModule\StructClass\Credentials $auth = null)
    {
        if (is_null($auth) || (is_array($auth) && empty($auth))) {
            unset($this->auth);
        } else {
            $this->auth = $auth;
        }
        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 \OXModule\StructClass\ChangeModuleAccessByName
     */
    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__;
    }
}
