<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for EGiorno StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:EGiorno
 * @subpackage Structs
 */
class EGiorno extends AbstractStructBase
{
    /**
     * The Data
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Data;
    /**
     * The Eventi
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var ArrayOfEvento
     */
    public $Eventi;
    /**
     * Constructor method for EGiorno
     * @uses EGiorno::setData()
     * @uses EGiorno::setEventi()
     * @param string $data
     * @param ArrayOfEvento $eventi
     */
    public function __construct($data = null, ArrayOfEvento $eventi = null)
    {
        $this
            ->setData($data)
            ->setEventi($eventi);
    }
    /**
     * 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 EGiorno
     */
    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 Eventi 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 ArrayOfEvento|null
     */
    public function getEventi()
    {
        return isset($this->Eventi) ? $this->Eventi : null;
    }
    /**
     * Set Eventi 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 ArrayOfEvento $eventi
     * @return EGiorno
     */
    public function setEventi(ArrayOfEvento $eventi = null)
    {
        if (is_null($eventi) || (is_array($eventi) && empty($eventi))) {
            unset($this->Eventi);
        } else {
            $this->Eventi = $eventi;
        }
        return $this;
    }
}
