<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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