<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Sales.BenefitPackageElementExtended StructType
 * @subpackage Structs
 */
class Sales_BenefitPackageElementExtended extends Sales_BenefitPackageElement
{
    /**
     * The ItemRulesLocalIds
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $ItemRulesLocalIds;
    /**
     * The PricingRuleLocalId
     * Meta information extracted from the WSDL
     * - documentation: Calculated.
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $PricingRuleLocalId;
    /**
     * Constructor method for Sales.BenefitPackageElementExtended
     * @uses Sales_BenefitPackageElementExtended::setItemRulesLocalIds()
     * @uses Sales_BenefitPackageElementExtended::setPricingRuleLocalId()
     * @param string $itemRulesLocalIds
     * @param int $pricingRuleLocalId
     */
    public function __construct($itemRulesLocalIds = null, $pricingRuleLocalId = null)
    {
        $this
            ->setItemRulesLocalIds($itemRulesLocalIds)
            ->setPricingRuleLocalId($pricingRuleLocalId);
    }
    /**
     * Get ItemRulesLocalIds 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 getItemRulesLocalIds()
    {
        return isset($this->ItemRulesLocalIds) ? $this->ItemRulesLocalIds : null;
    }
    /**
     * Set ItemRulesLocalIds 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 $itemRulesLocalIds
     * @return \patest\StructType\Sales_BenefitPackageElementExtended
     */
    public function setItemRulesLocalIds($itemRulesLocalIds = null)
    {
        // validation for constraint: string
        if (!is_null($itemRulesLocalIds) && !is_string($itemRulesLocalIds)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($itemRulesLocalIds, true), gettype($itemRulesLocalIds)), __LINE__);
        }
        if (is_null($itemRulesLocalIds) || (is_array($itemRulesLocalIds) && empty($itemRulesLocalIds))) {
            unset($this->ItemRulesLocalIds);
        } else {
            $this->ItemRulesLocalIds = $itemRulesLocalIds;
        }
        return $this;
    }
    /**
     * Get PricingRuleLocalId 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 getPricingRuleLocalId()
    {
        return isset($this->PricingRuleLocalId) ? $this->PricingRuleLocalId : null;
    }
    /**
     * Set PricingRuleLocalId 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 $pricingRuleLocalId
     * @return \patest\StructType\Sales_BenefitPackageElementExtended
     */
    public function setPricingRuleLocalId($pricingRuleLocalId = null)
    {
        // validation for constraint: int
        if (!is_null($pricingRuleLocalId) && !(is_int($pricingRuleLocalId) || ctype_digit($pricingRuleLocalId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($pricingRuleLocalId, true), gettype($pricingRuleLocalId)), __LINE__);
        }
        if (is_null($pricingRuleLocalId) || (is_array($pricingRuleLocalId) && empty($pricingRuleLocalId))) {
            unset($this->PricingRuleLocalId);
        } else {
            $this->PricingRuleLocalId = $pricingRuleLocalId;
        }
        return $this;
    }
}
