<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SeatUnavailableFault StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SeatUnavailableFault
 * @subpackage Structs
 */
class SeatUnavailableFault extends BasicFault
{
    /**
     * The MaxAvailable
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $MaxAvailable;
    /**
     * Constructor method for SeatUnavailableFault
     * @uses SeatUnavailableFault::setMaxAvailable()
     * @param int $maxAvailable
     */
    public function __construct($maxAvailable = null)
    {
        $this
            ->setMaxAvailable($maxAvailable);
    }
    /**
     * Get MaxAvailable 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 getMaxAvailable()
    {
        return isset($this->MaxAvailable) ? $this->MaxAvailable : null;
    }
    /**
     * Set MaxAvailable 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 $maxAvailable
     * @return \patest\StructType\SeatUnavailableFault
     */
    public function setMaxAvailable($maxAvailable = null)
    {
        // validation for constraint: int
        if (!is_null($maxAvailable) && !(is_int($maxAvailable) || ctype_digit($maxAvailable))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($maxAvailable, true), gettype($maxAvailable)), __LINE__);
        }
        if (is_null($maxAvailable) || (is_array($maxAvailable) && empty($maxAvailable))) {
            unset($this->MaxAvailable);
        } else {
            $this->MaxAvailable = $maxAvailable;
        }
        return $this;
    }
}
