<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for DistributorType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgDistributorType extends AbstractStructBase
{
    /**
     * The _
     * @var string
     */
    public $_;
    /**
     * The DistributorCode
     * @var string
     */
    public $DistributorCode;
    /**
     * The DistributorTypeCode
     * @var string
     */
    public $DistributorTypeCode;
    /**
     * Constructor method for DistributorType
     * @uses DgDistributorType::set_()
     * @uses DgDistributorType::setDistributorCode()
     * @uses DgDistributorType::setDistributorTypeCode()
     * @param string $_
     * @param string $distributorCode
     * @param string $distributorTypeCode
     */
    public function __construct($_ = null, $distributorCode = null, $distributorTypeCode = null)
    {
        $this
            ->set_($_)
            ->setDistributorCode($distributorCode)
            ->setDistributorTypeCode($distributorTypeCode);
    }
    /**
     * Get _ value
     * @return string|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param string $_
     * @return \dgsoft\StructType\DgDistributorType
     */
    public function set_($_ = null)
    {
        // validation for constraint: string
        if (!is_null($_) && !is_string($_)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($_)), __LINE__);
        }
        $this->_ = $_;
        return $this;
    }
    /**
     * Get DistributorCode value
     * @return string|null
     */
    public function getDistributorCode()
    {
        return $this->DistributorCode;
    }
    /**
     * Set DistributorCode value
     * @param string $distributorCode
     * @return \dgsoft\StructType\DgDistributorType
     */
    public function setDistributorCode($distributorCode = null)
    {
        // validation for constraint: string
        if (!is_null($distributorCode) && !is_string($distributorCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($distributorCode)), __LINE__);
        }
        $this->DistributorCode = $distributorCode;
        return $this;
    }
    /**
     * Get DistributorTypeCode value
     * @return string|null
     */
    public function getDistributorTypeCode()
    {
        return $this->DistributorTypeCode;
    }
    /**
     * Set DistributorTypeCode value
     * @param string $distributorTypeCode
     * @return \dgsoft\StructType\DgDistributorType
     */
    public function setDistributorTypeCode($distributorTypeCode = null)
    {
        // validation for constraint: string
        if (!is_null($distributorTypeCode) && !is_string($distributorTypeCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($distributorTypeCode)), __LINE__);
        }
        $this->DistributorTypeCode = $distributorTypeCode;
        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 \dgsoft\StructType\DgDistributorType
     */
    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__;
    }
}
