<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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