<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TicketDistribPref StructType
 * @package Dg
 * @subpackage Structs
 */
class DgTicketDistribPref extends DgTicketDistribPrefType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgTicketDistribPrefType
     */
    public $_;
    /**
     * The LastTicketDate
     * @var string
     */
    public $LastTicketDate;
    /**
     * The FirstTicketDate
     * @var string
     */
    public $FirstTicketDate;
    /**
     * Constructor method for TicketDistribPref
     * @uses DgTicketDistribPref::set_()
     * @uses DgTicketDistribPref::setLastTicketDate()
     * @uses DgTicketDistribPref::setFirstTicketDate()
     * @param \dgsoft\StructType\DgTicketDistribPrefType $_
     * @param string $lastTicketDate
     * @param string $firstTicketDate
     */
    public function __construct(\dgsoft\StructType\DgTicketDistribPrefType $_ = null, $lastTicketDate = null, $firstTicketDate = null)
    {
        $this
            ->set_($_)
            ->setLastTicketDate($lastTicketDate)
            ->setFirstTicketDate($firstTicketDate);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgTicketDistribPrefType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgTicketDistribPrefType $_
     * @return \dgsoft\StructType\DgTicketDistribPref
     */
    public function set_(\dgsoft\StructType\DgTicketDistribPrefType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get LastTicketDate value
     * @return string|null
     */
    public function getLastTicketDate()
    {
        return $this->LastTicketDate;
    }
    /**
     * Set LastTicketDate value
     * @param string $lastTicketDate
     * @return \dgsoft\StructType\DgTicketDistribPref
     */
    public function setLastTicketDate($lastTicketDate = null)
    {
        // validation for constraint: string
        if (!is_null($lastTicketDate) && !is_string($lastTicketDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastTicketDate)), __LINE__);
        }
        $this->LastTicketDate = $lastTicketDate;
        return $this;
    }
    /**
     * Get FirstTicketDate value
     * @return string|null
     */
    public function getFirstTicketDate()
    {
        return $this->FirstTicketDate;
    }
    /**
     * Set FirstTicketDate value
     * @param string $firstTicketDate
     * @return \dgsoft\StructType\DgTicketDistribPref
     */
    public function setFirstTicketDate($firstTicketDate = null)
    {
        // validation for constraint: string
        if (!is_null($firstTicketDate) && !is_string($firstTicketDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($firstTicketDate)), __LINE__);
        }
        $this->FirstTicketDate = $firstTicketDate;
        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 \dgsoft\StructType\DgTicketDistribPref
     */
    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__;
    }
}
