<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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