<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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