<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Security.PricingCompanyParameters StructType
 * @subpackage Structs
 */
class Security_PricingCompanyParameters extends Security_CompanyParameterBase
{
    /**
     * The UseRestrictivePriceTypeRules
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $UseRestrictivePriceTypeRules;
    /**
     * Constructor method for Security.PricingCompanyParameters
     * @uses Security_PricingCompanyParameters::setUseRestrictivePriceTypeRules()
     * @param bool $useRestrictivePriceTypeRules
     */
    public function __construct($useRestrictivePriceTypeRules = null)
    {
        $this
            ->setUseRestrictivePriceTypeRules($useRestrictivePriceTypeRules);
    }
    /**
     * Get UseRestrictivePriceTypeRules 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 bool|null
     */
    public function getUseRestrictivePriceTypeRules()
    {
        return isset($this->UseRestrictivePriceTypeRules) ? $this->UseRestrictivePriceTypeRules : null;
    }
    /**
     * Set UseRestrictivePriceTypeRules 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 bool $useRestrictivePriceTypeRules
     * @return \patest\StructType\Security_PricingCompanyParameters
     */
    public function setUseRestrictivePriceTypeRules($useRestrictivePriceTypeRules = null)
    {
        // validation for constraint: boolean
        if (!is_null($useRestrictivePriceTypeRules) && !is_bool($useRestrictivePriceTypeRules)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($useRestrictivePriceTypeRules, true), gettype($useRestrictivePriceTypeRules)), __LINE__);
        }
        if (is_null($useRestrictivePriceTypeRules) || (is_array($useRestrictivePriceTypeRules) && empty($useRestrictivePriceTypeRules))) {
            unset($this->UseRestrictivePriceTypeRules);
        } else {
            $this->UseRestrictivePriceTypeRules = $useRestrictivePriceTypeRules;
        }
        return $this;
    }
}
