<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for GetAvailableEvents-Response StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:GetAvailableEvents-Response
 * @subpackage Structs
 */
class GetAvailableEvents_Response extends ExtensibleDataContract
{
    /**
     * The Events
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfEventDescription
     */
    public $Events;
    /**
     * Constructor method for GetAvailableEvents-Response
     * @uses GetAvailableEvents_Response::setEvents()
     * @param \patest\ArrayType\ArrayOfEventDescription $events
     */
    public function __construct(\patest\ArrayType\ArrayOfEventDescription $events = null)
    {
        $this
            ->setEvents($events);
    }
    /**
     * Get Events 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 \patest\ArrayType\ArrayOfEventDescription|null
     */
    public function getEvents()
    {
        return isset($this->Events) ? $this->Events : null;
    }
    /**
     * Set Events 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 \patest\ArrayType\ArrayOfEventDescription $events
     * @return \patest\StructType\GetAvailableEvents_Response
     */
    public function setEvents(\patest\ArrayType\ArrayOfEventDescription $events = null)
    {
        if (is_null($events) || (is_array($events) && empty($events))) {
            unset($this->Events);
        } else {
            $this->Events = $events;
        }
        return $this;
    }
}
