<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CommissionInfoType StructType
 * @package Dg
 * @subpackage Structs
 */
class DgCommissionInfoType extends DgFreeTextType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgFreeTextType
     */
    public $_;
    /**
     * The ShareSynchInd
     * @var string
     */
    public $ShareSynchInd;
    /**
     * The ShareMarketInd
     * @var string
     */
    public $ShareMarketInd;
    /**
     * The CommissionPlanCode
     * @var string
     */
    public $CommissionPlanCode;
    /**
     * The Amount
     * @var float
     */
    public $Amount;
    /**
     * Constructor method for CommissionInfoType
     * @uses DgCommissionInfoType::set_()
     * @uses DgCommissionInfoType::setShareSynchInd()
     * @uses DgCommissionInfoType::setShareMarketInd()
     * @uses DgCommissionInfoType::setCommissionPlanCode()
     * @uses DgCommissionInfoType::setAmount()
     * @param \dgsoft\StructType\DgFreeTextType $_
     * @param string $shareSynchInd
     * @param string $shareMarketInd
     * @param string $commissionPlanCode
     * @param float $amount
     */
    public function __construct(\dgsoft\StructType\DgFreeTextType $_ = null, $shareSynchInd = null, $shareMarketInd = null, $commissionPlanCode = null, $amount = null)
    {
        $this
            ->set_($_)
            ->setShareSynchInd($shareSynchInd)
            ->setShareMarketInd($shareMarketInd)
            ->setCommissionPlanCode($commissionPlanCode)
            ->setAmount($amount);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgFreeTextType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgFreeTextType $_
     * @return \dgsoft\StructType\DgCommissionInfoType
     */
    public function set_(\dgsoft\StructType\DgFreeTextType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get ShareSynchInd value
     * @return string|null
     */
    public function getShareSynchInd()
    {
        return $this->ShareSynchInd;
    }
    /**
     * Set ShareSynchInd value
     * @param string $shareSynchInd
     * @return \dgsoft\StructType\DgCommissionInfoType
     */
    public function setShareSynchInd($shareSynchInd = null)
    {
        // validation for constraint: string
        if (!is_null($shareSynchInd) && !is_string($shareSynchInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shareSynchInd)), __LINE__);
        }
        $this->ShareSynchInd = $shareSynchInd;
        return $this;
    }
    /**
     * Get ShareMarketInd value
     * @return string|null
     */
    public function getShareMarketInd()
    {
        return $this->ShareMarketInd;
    }
    /**
     * Set ShareMarketInd value
     * @param string $shareMarketInd
     * @return \dgsoft\StructType\DgCommissionInfoType
     */
    public function setShareMarketInd($shareMarketInd = null)
    {
        // validation for constraint: string
        if (!is_null($shareMarketInd) && !is_string($shareMarketInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shareMarketInd)), __LINE__);
        }
        $this->ShareMarketInd = $shareMarketInd;
        return $this;
    }
    /**
     * Get CommissionPlanCode value
     * @return string|null
     */
    public function getCommissionPlanCode()
    {
        return $this->CommissionPlanCode;
    }
    /**
     * Set CommissionPlanCode value
     * @param string $commissionPlanCode
     * @return \dgsoft\StructType\DgCommissionInfoType
     */
    public function setCommissionPlanCode($commissionPlanCode = null)
    {
        // validation for constraint: string
        if (!is_null($commissionPlanCode) && !is_string($commissionPlanCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($commissionPlanCode)), __LINE__);
        }
        $this->CommissionPlanCode = $commissionPlanCode;
        return $this;
    }
    /**
     * Get Amount value
     * @return float|null
     */
    public function getAmount()
    {
        return $this->Amount;
    }
    /**
     * Set Amount value
     * @param float $amount
     * @return \dgsoft\StructType\DgCommissionInfoType
     */
    public function setAmount($amount = null)
    {
        $this->Amount = $amount;
        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\DgCommissionInfoType
     */
    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__;
    }
}
