<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AnagrafePrivacy_Model StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:AnagrafePrivacy_Model
 * @subpackage Structs
 */
class AnagrafePrivacy_Model extends AbstractStructBase
{
    /**
     * The DataFine
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $DataFine;
    /**
     * The DataInizio
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $DataInizio;
    /**
     * The ID
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var int
     */
    public $ID;
    /**
     * The Privacy
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var Privacy_Model
     */
    public $Privacy;
    /**
     * Constructor method for AnagrafePrivacy_Model
     * @uses AnagrafePrivacy_Model::setDataFine()
     * @uses AnagrafePrivacy_Model::setDataInizio()
     * @uses AnagrafePrivacy_Model::setID()
     * @uses AnagrafePrivacy_Model::setPrivacy()
     * @param string $dataFine
     * @param string $dataInizio
     * @param int $iD
     * @param Privacy_Model $privacy
     */
    public function __construct($dataFine = null, $dataInizio = null, $iD = null, Privacy_Model $privacy = null)
    {
        $this
            ->setDataFine($dataFine)
            ->setDataInizio($dataInizio)
            ->setID($iD)
            ->setPrivacy($privacy);
    }
    /**
     * Get DataFine 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 getDataFine()
    {
        return isset($this->DataFine) ? $this->DataFine : null;
    }
    /**
     * Set DataFine 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 $dataFine
     * @return AnagrafePrivacy_Model
     */
    public function setDataFine($dataFine = null)
    {
        // validation for constraint: string
        if (!is_null($dataFine) && !is_string($dataFine)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dataFine, true), gettype($dataFine)), __LINE__);
        }
        if (is_null($dataFine) || (is_array($dataFine) && empty($dataFine))) {
            unset($this->DataFine);
        } else {
            $this->DataFine = $dataFine;
        }
        return $this;
    }
    /**
     * Get DataInizio 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 getDataInizio()
    {
        return isset($this->DataInizio) ? $this->DataInizio : null;
    }
    /**
     * Set DataInizio 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 $dataInizio
     * @return AnagrafePrivacy_Model
     */
    public function setDataInizio($dataInizio = null)
    {
        // validation for constraint: string
        if (!is_null($dataInizio) && !is_string($dataInizio)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($dataInizio, true), gettype($dataInizio)), __LINE__);
        }
        if (is_null($dataInizio) || (is_array($dataInizio) && empty($dataInizio))) {
            unset($this->DataInizio);
        } else {
            $this->DataInizio = $dataInizio;
        }
        return $this;
    }
    /**
     * Get ID value
     * @return int|null
     */
    public function getID()
    {
        return $this->ID;
    }
    /**
     * Set ID value
     * @param int $iD
     * @return AnagrafePrivacy_Model
     */
    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 Privacy 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 Privacy_Model|null
     */
    public function getPrivacy()
    {
        return isset($this->Privacy) ? $this->Privacy : null;
    }
    /**
     * Set Privacy 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 Privacy_Model $privacy
     * @return AnagrafePrivacy_Model
     */
    public function setPrivacy(Privacy_Model $privacy = null)
    {
        if (is_null($privacy) || (is_array($privacy) && empty($privacy))) {
            unset($this->Privacy);
        } else {
            $this->Privacy = $privacy;
        }
        return $this;
    }
}
