<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BizAction.Foundation.RulesOverview.RuleSet StructType
 * @subpackage Structs
 */
class BizAction_Foundation_RulesOverview_RuleSet extends BizAction_Foundation_RulesOverview_RuleSetBase
{
    /**
     * The Global
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\BizAction_Foundation_RulesOverview_GlobalRuleSet
     */
    public $Global;
    /**
     * The IsGlobal
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $IsGlobal;
    /**
     * The Name
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Name;
    /**
     * Constructor method for BizAction.Foundation.RulesOverview.RuleSet
     * @uses BizAction_Foundation_RulesOverview_RuleSet::setGlobal()
     * @uses BizAction_Foundation_RulesOverview_RuleSet::setIsGlobal()
     * @uses BizAction_Foundation_RulesOverview_RuleSet::setName()
     * @param \patest\StructType\BizAction_Foundation_RulesOverview_GlobalRuleSet $global
     * @param bool $isGlobal
     * @param string $name
     */
    public function __construct(\patest\StructType\BizAction_Foundation_RulesOverview_GlobalRuleSet $global = null, $isGlobal = null, $name = null)
    {
        $this
            ->setGlobal($global)
            ->setIsGlobal($isGlobal)
            ->setName($name);
    }
    /**
     * Get Global 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\BizAction_Foundation_RulesOverview_GlobalRuleSet|null
     */
    public function getGlobal()
    {
        return isset($this->Global) ? $this->Global : null;
    }
    /**
     * Set Global 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\BizAction_Foundation_RulesOverview_GlobalRuleSet $global
     * @return \patest\StructType\BizAction_Foundation_RulesOverview_RuleSet
     */
    public function setGlobal(\patest\StructType\BizAction_Foundation_RulesOverview_GlobalRuleSet $global = null)
    {
        if (is_null($global) || (is_array($global) && empty($global))) {
            unset($this->Global);
        } else {
            $this->Global = $global;
        }
        return $this;
    }
    /**
     * Get IsGlobal 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 bool|null
     */
    public function getIsGlobal()
    {
        return isset($this->IsGlobal) ? $this->IsGlobal : null;
    }
    /**
     * Set IsGlobal 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 bool $isGlobal
     * @return \patest\StructType\BizAction_Foundation_RulesOverview_RuleSet
     */
    public function setIsGlobal($isGlobal = null)
    {
        // validation for constraint: boolean
        if (!is_null($isGlobal) && !is_bool($isGlobal)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($isGlobal, true), gettype($isGlobal)), __LINE__);
        }
        if (is_null($isGlobal) || (is_array($isGlobal) && empty($isGlobal))) {
            unset($this->IsGlobal);
        } else {
            $this->IsGlobal = $isGlobal;
        }
        return $this;
    }
    /**
     * Get 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 getName()
    {
        return isset($this->Name) ? $this->Name : null;
    }
    /**
     * Set 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 $name
     * @return \patest\StructType\BizAction_Foundation_RulesOverview_RuleSet
     */
    public function setName($name = null)
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
        }
        if (is_null($name) || (is_array($name) && empty($name))) {
            unset($this->Name);
        } else {
            $this->Name = $name;
        }
        return $this;
    }
}
