<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Messaggio StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:Messaggio
 * @subpackage Structs
 */
class Messaggio extends AbstractStructBase
{
    /**
     * The DataFineValidita
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $DataFineValidita;
    /**
     * The DataInizioValidita
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $DataInizioValidita;
    /**
     * The ID
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var int
     */
    public $ID;
    /**
     * The Oggetto
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Oggetto;
    /**
     * The Testo
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Testo;
    /**
     * The Titolo
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Titolo;
    /**
     * Constructor method for Messaggio
     * @uses Messaggio::setDataFineValidita()
     * @uses Messaggio::setDataInizioValidita()
     * @uses Messaggio::setID()
     * @uses Messaggio::setOggetto()
     * @uses Messaggio::setTesto()
     * @uses Messaggio::setTitolo()
     * @param string $dataFineValidita
     * @param string $dataInizioValidita
     * @param int $iD
     * @param string $oggetto
     * @param string $testo
     * @param string $titolo
     */
    public function __construct($dataFineValidita = null, $dataInizioValidita = null, $iD = null, $oggetto = null, $testo = null, $titolo = null)
    {
        $this
            ->setDataFineValidita($dataFineValidita)
            ->setDataInizioValidita($dataInizioValidita)
            ->setID($iD)
            ->setOggetto($oggetto)
            ->setTesto($testo)
            ->setTitolo($titolo);
    }
    /**
     * Get DataFineValidita 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 string|null
     */
    public function getDataFineValidita()
    {
        return isset($this->DataFineValidita) ? $this->DataFineValidita : null;
    }
    /**
     * Set DataFineValidita 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 string $dataFineValidita
     * @return Messaggio
     */
    public function setDataFineValidita($dataFineValidita = null)
    {
        // validation for constraint: string
        if (!is_null($dataFineValidita) && !is_string($dataFineValidita)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dataFineValidita, true), gettype($dataFineValidita)), __LINE__);
        }
        if (is_null($dataFineValidita) || (is_array($dataFineValidita) && empty($dataFineValidita))) {
            unset($this->DataFineValidita);
        } else {
            $this->DataFineValidita = $dataFineValidita;
        }
        return $this;
    }
    /**
     * Get DataInizioValidita 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 string|null
     */
    public function getDataInizioValidita()
    {
        return isset($this->DataInizioValidita) ? $this->DataInizioValidita : null;
    }
    /**
     * Set DataInizioValidita 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 string $dataInizioValidita
     * @return Messaggio
     */
    public function setDataInizioValidita($dataInizioValidita = null)
    {
        // validation for constraint: string
        if (!is_null($dataInizioValidita) && !is_string($dataInizioValidita)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dataInizioValidita, true), gettype($dataInizioValidita)), __LINE__);
        }
        if (is_null($dataInizioValidita) || (is_array($dataInizioValidita) && empty($dataInizioValidita))) {
            unset($this->DataInizioValidita);
        } else {
            $this->DataInizioValidita = $dataInizioValidita;
        }
        return $this;
    }
    /**
     * Get ID value
     * @return int|null
     */
    public function getID()
    {
        return $this->ID;
    }
    /**
     * Set ID value
     * @param int $iD
     * @return Messaggio
     */
    public function setID($iD = null)
    {
        // validation for constraint: int
        if (!is_null($iD) && !(is_int($iD) || ctype_digit($iD))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($iD, true), gettype($iD)), __LINE__);
        }
        $this->ID = $iD;
        return $this;
    }
    /**
     * Get Oggetto 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 string|null
     */
    public function getOggetto()
    {
        return isset($this->Oggetto) ? $this->Oggetto : null;
    }
    /**
     * Set Oggetto 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 string $oggetto
     * @return Messaggio
     */
    public function setOggetto($oggetto = null)
    {
        // validation for constraint: string
        if (!is_null($oggetto) && !is_string($oggetto)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($oggetto, true), gettype($oggetto)), __LINE__);
        }
        if (is_null($oggetto) || (is_array($oggetto) && empty($oggetto))) {
            unset($this->Oggetto);
        } else {
            $this->Oggetto = $oggetto;
        }
        return $this;
    }
    /**
     * Get Testo 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 string|null
     */
    public function getTesto()
    {
        return isset($this->Testo) ? $this->Testo : null;
    }
    /**
     * Set Testo 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 string $testo
     * @return Messaggio
     */
    public function setTesto($testo = null)
    {
        // validation for constraint: string
        if (!is_null($testo) && !is_string($testo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($testo, true), gettype($testo)), __LINE__);
        }
        if (is_null($testo) || (is_array($testo) && empty($testo))) {
            unset($this->Testo);
        } else {
            $this->Testo = $testo;
        }
        return $this;
    }
    /**
     * Get Titolo 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 string|null
     */
    public function getTitolo()
    {
        return isset($this->Titolo) ? $this->Titolo : null;
    }
    /**
     * Set Titolo 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 string $titolo
     * @return Messaggio
     */
    public function setTitolo($titolo = null)
    {
        // validation for constraint: string
        if (!is_null($titolo) && !is_string($titolo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($titolo, true), gettype($titolo)), __LINE__);
        }
        if (is_null($titolo) || (is_array($titolo) && empty($titolo))) {
            unset($this->Titolo);
        } else {
            $this->Titolo = $titolo;
        }
        return $this;
    }
}
