<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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