<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_PackageAvailAdvancedOptions StructType
 * @subpackage Structs
 */
class JP_PackageAvailAdvancedOptions extends JP_AvailAdvancedOptions
{
    /**
     * The ShowOnlyAvailable
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var bool
     */
    public $ShowOnlyAvailable;
    /**
     * Constructor method for JP_PackageAvailAdvancedOptions
     * @uses JP_PackageAvailAdvancedOptions::setShowOnlyAvailable()
     * @param bool $showOnlyAvailable
     */
    public function __construct($showOnlyAvailable = null)
    {
        $this
            ->setShowOnlyAvailable($showOnlyAvailable);
    }
    /**
     * Get ShowOnlyAvailable value
     * @return bool|null
     */
    public function getShowOnlyAvailable()
    {
        return $this->ShowOnlyAvailable;
    }
    /**
     * Set ShowOnlyAvailable value
     * @param bool $showOnlyAvailable
     * @return \StructType\JP_PackageAvailAdvancedOptions
     */
    public function setShowOnlyAvailable($showOnlyAvailable = null)
    {
        // validation for constraint: boolean
        if (!is_null($showOnlyAvailable) && !is_bool($showOnlyAvailable)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($showOnlyAvailable)), __LINE__);
        }
        $this->ShowOnlyAvailable = $showOnlyAvailable;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \StructType\JP_PackageAvailAdvancedOptions
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
