<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Sales.BenefitPackageProductElement StructType
 * @subpackage Structs
 */
class Sales_BenefitPackageProductElement extends Sales_BenefitPackageElement
{
    /**
     * The ActionList
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\RecordSetOfRuleEngine_Action
     */
    public $ActionList;
    /**
     * The RelatedItemTypeId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $RelatedItemTypeId;
    /**
     * The ValueForTax
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var float
     */
    public $ValueForTax;
    /**
     * Constructor method for Sales.BenefitPackageProductElement
     * @uses Sales_BenefitPackageProductElement::setActionList()
     * @uses Sales_BenefitPackageProductElement::setRelatedItemTypeId()
     * @uses Sales_BenefitPackageProductElement::setValueForTax()
     * @param \patest\StructType\RecordSetOfRuleEngine_Action $actionList
     * @param int $relatedItemTypeId
     * @param float $valueForTax
     */
    public function __construct(\patest\StructType\RecordSetOfRuleEngine_Action $actionList = null, $relatedItemTypeId = null, $valueForTax = null)
    {
        $this
            ->setActionList($actionList)
            ->setRelatedItemTypeId($relatedItemTypeId)
            ->setValueForTax($valueForTax);
    }
    /**
     * Get ActionList 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\RecordSetOfRuleEngine_Action|null
     */
    public function getActionList()
    {
        return isset($this->ActionList) ? $this->ActionList : null;
    }
    /**
     * Set ActionList 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\RecordSetOfRuleEngine_Action $actionList
     * @return \patest\StructType\Sales_BenefitPackageProductElement
     */
    public function setActionList(\patest\StructType\RecordSetOfRuleEngine_Action $actionList = null)
    {
        if (is_null($actionList) || (is_array($actionList) && empty($actionList))) {
            unset($this->ActionList);
        } else {
            $this->ActionList = $actionList;
        }
        return $this;
    }
    /**
     * Get RelatedItemTypeId 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 int|null
     */
    public function getRelatedItemTypeId()
    {
        return isset($this->RelatedItemTypeId) ? $this->RelatedItemTypeId : null;
    }
    /**
     * Set RelatedItemTypeId 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 int $relatedItemTypeId
     * @return \patest\StructType\Sales_BenefitPackageProductElement
     */
    public function setRelatedItemTypeId($relatedItemTypeId = null)
    {
        // validation for constraint: int
        if (!is_null($relatedItemTypeId) && !(is_int($relatedItemTypeId) || ctype_digit($relatedItemTypeId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($relatedItemTypeId, true), gettype($relatedItemTypeId)), __LINE__);
        }
        if (is_null($relatedItemTypeId) || (is_array($relatedItemTypeId) && empty($relatedItemTypeId))) {
            unset($this->RelatedItemTypeId);
        } else {
            $this->RelatedItemTypeId = $relatedItemTypeId;
        }
        return $this;
    }
    /**
     * Get ValueForTax 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 float|null
     */
    public function getValueForTax()
    {
        return isset($this->ValueForTax) ? $this->ValueForTax : null;
    }
    /**
     * Set ValueForTax 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 float $valueForTax
     * @return \patest\StructType\Sales_BenefitPackageProductElement
     */
    public function setValueForTax($valueForTax = null)
    {
        // validation for constraint: float
        if (!is_null($valueForTax) && !(is_float($valueForTax) || is_numeric($valueForTax))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a float value, %s given', var_export($valueForTax, true), gettype($valueForTax)), __LINE__);
        }
        if (is_null($valueForTax) || (is_array($valueForTax) && empty($valueForTax))) {
            unset($this->ValueForTax);
        } else {
            $this->ValueForTax = $valueForTax;
        }
        return $this;
    }
}
