<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TGiorno StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:TGiorno
 * @subpackage Structs
 */
class TGiorno extends AbstractStructBase
{
    /**
     * The Data
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Data;
    /**
     * The Turni
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var ArrayOfTurno
     */
    public $Turni;
    /**
     * Constructor method for TGiorno
     * @uses TGiorno::setData()
     * @uses TGiorno::setTurni()
     * @param string $data
     * @param ArrayOfTurno $turni
     */
    public function __construct($data = null, ArrayOfTurno $turni = null)
    {
        $this
            ->setData($data)
            ->setTurni($turni);
    }
    /**
     * Get Data 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 getData()
    {
        return isset($this->Data) ? $this->Data : null;
    }
    /**
     * Set Data 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 $data
     * @return TGiorno
     */
    public function setData($data = null)
    {
        // validation for constraint: string
        if (!is_null($data) && !is_string($data)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($data, true), gettype($data)), __LINE__);
        }
        if (is_null($data) || (is_array($data) && empty($data))) {
            unset($this->Data);
        } else {
            $this->Data = $data;
        }
        return $this;
    }
    /**
     * Get Turni 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 ArrayOfTurno|null
     */
    public function getTurni()
    {
        return isset($this->Turni) ? $this->Turni : null;
    }
    /**
     * Set Turni 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 ArrayOfTurno $turni
     * @return TGiorno
     */
    public function setTurni(ArrayOfTurno $turni = null)
    {
        if (is_null($turni) || (is_array($turni) && empty($turni))) {
            unset($this->Turni);
        } else {
            $this->Turni = $turni;
        }
        return $this;
    }
}
