<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for sigDigits StructType
 * Meta informations extracted from the WSDL
 * - documentation: The value of significantDigits must either from 0 to 32 or 99,Here 99 means ALL.enable attribute is Read-Only.If significantDigits is 0-32 then enable is true,if significantDigits is 99 then enable is false. | The value of
 * significantDigits must either from 0 to 32 or 99,Here 99 means ALL.enable attribute is Read-Only.If significantDigits is 0-32 then enable is true,if significantDigits is 99 then enable is false. | The value of significantDigits must either from 0 to
 * 32 or 99,Here 99 means ALL.enable attribute is Read-Only.If significantDigits is 0-32 then enable is true,if significantDigits is 99 then enable is false. | The value of significantDigits must either from 0 to 32 or 99,Here 99 means ALL.enable
 * attribute is Read-Only.If significantDigits is 0-32 then enable is true,if significantDigits is 99 then enable is false. | The value for sigDigits must be between 0 to 32. enable attribute is read only | The value for sigDigits must be between 0 to
 * 32. enable attribute is read only | The value for sigDigits must be between 0 to 32. enable attribute is read only | The value for sigDigits must be between 0 to 32. enable attribute is read only | The value of sigDigits must be either from 0 to 32
 * or 99. Here 99 means All. enable attribute is Read-Only. If sigDigits is 0-32 then enable is true, if sigDigits is 99 then enable is false. | The value of sigDigits must be either from 0 to 32 or 99. Here 99 means All. enable attribute is Read-Only.
 * If sigDigits is 0-32 then enable is true, if sigDigits is 99 then enable is false. | The value for sigDigits must be between 0 to 32. enable attribute is read only. | The value for sigDigits must be between 0 to 32. enable attribute is read only |
 * The value for sigDigits must be between 0 to 32. enable attribute is read only | The value for sigDigits must be between 0 to 32. enable attribute is read only
 * @subpackage Structs
 */
class SigDigits extends XInteger
{
    /**
     * The _
     * @var string
     */
    public $_;
    /**
     * The enable
     * Meta informations extracted from the WSDL
     * - use: optional
     * - pattern: (t)|(f)|(true)|(false)|(0)|(1)
     * @var string
     */
    public $enable;
    /**
     * Constructor method for sigDigits
     * @uses SigDigits::set_()
     * @uses SigDigits::setEnable()
     * @param string $_
     * @param string $enable
     */
    public function __construct($_ = null, $enable = null)
    {
        $this
            ->set_($_)
            ->setEnable($enable);
    }
    /**
     * Get _ value
     * @return string|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $_
     * @return SigDigits
     */
    public function set_($_ = null)
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($_)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $_, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
    /**
     * Get enable value
     * @return string|null
     */
    public function getEnable()
    {
        return $this->enable;
    }
    /**
     * Set enable value
     * @param string $enable
     * @return SigDigits
     */
    public function setEnable($enable = null)
    {
        // validation for constraint: pattern
        if (is_scalar($enable) && !preg_match('/(t)|(f)|(true)|(false)|(0)|(1)/', $enable)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "(t)|(f)|(true)|(false)|(0)|(1)", "%s" given', var_export($enable, true)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($enable) && !is_string($enable)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($enable)), __LINE__);
        }
        $this->enable = $enable;
        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 SigDigits
     */
    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__;
    }
}
