<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for bSRO.Sales.ContextSelectTicketNumber StructType
 * @subpackage Structs
 */
class BSRO_Sales_ContextSelectTicketNumber extends AnyEntity
{
    /**
     * The FromTicketNumber
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $FromTicketNumber;
    /**
     * The ToTicketNumber
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $ToTicketNumber;
    /**
     * Constructor method for bSRO.Sales.ContextSelectTicketNumber
     * @uses BSRO_Sales_ContextSelectTicketNumber::setFromTicketNumber()
     * @uses BSRO_Sales_ContextSelectTicketNumber::setToTicketNumber()
     * @param int $fromTicketNumber
     * @param int $toTicketNumber
     */
    public function __construct($fromTicketNumber = null, $toTicketNumber = null)
    {
        $this
            ->setFromTicketNumber($fromTicketNumber)
            ->setToTicketNumber($toTicketNumber);
    }
    /**
     * Get FromTicketNumber 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 getFromTicketNumber()
    {
        return isset($this->FromTicketNumber) ? $this->FromTicketNumber : null;
    }
    /**
     * Set FromTicketNumber 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 $fromTicketNumber
     * @return \patest\StructType\BSRO_Sales_ContextSelectTicketNumber
     */
    public function setFromTicketNumber($fromTicketNumber = null)
    {
        // validation for constraint: int
        if (!is_null($fromTicketNumber) && !(is_int($fromTicketNumber) || ctype_digit($fromTicketNumber))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($fromTicketNumber, true), gettype($fromTicketNumber)), __LINE__);
        }
        if (is_null($fromTicketNumber) || (is_array($fromTicketNumber) && empty($fromTicketNumber))) {
            unset($this->FromTicketNumber);
        } else {
            $this->FromTicketNumber = $fromTicketNumber;
        }
        return $this;
    }
    /**
     * Get ToTicketNumber 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 getToTicketNumber()
    {
        return isset($this->ToTicketNumber) ? $this->ToTicketNumber : null;
    }
    /**
     * Set ToTicketNumber 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 $toTicketNumber
     * @return \patest\StructType\BSRO_Sales_ContextSelectTicketNumber
     */
    public function setToTicketNumber($toTicketNumber = null)
    {
        // validation for constraint: int
        if (!is_null($toTicketNumber) && !(is_int($toTicketNumber) || ctype_digit($toTicketNumber))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($toTicketNumber, true), gettype($toTicketNumber)), __LINE__);
        }
        if (is_null($toTicketNumber) || (is_array($toTicketNumber) && empty($toTicketNumber))) {
            unset($this->ToTicketNumber);
        } else {
            $this->ToTicketNumber = $toTicketNumber;
        }
        return $this;
    }
}
