<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for SearchForMatchingGiftsOptions-Response StructType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:SearchForMatchingGiftsOptions-Response
 * @subpackage Structs
 */
class SearchForMatchingGiftsOptions_Response extends ExtensibleDataContract
{
    /**
     * The GlobalGrantingRelationships
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfMatchingGiftOptionRelationshipDetail
     */
    public $GlobalGrantingRelationships;
    /**
     * The MatchingGiftOptions
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\ArrayType\ArrayOfMatchingGiftOption
     */
    public $MatchingGiftOptions;
    /**
     * Constructor method for SearchForMatchingGiftsOptions-Response
     * @uses SearchForMatchingGiftsOptions_Response::setGlobalGrantingRelationships()
     * @uses SearchForMatchingGiftsOptions_Response::setMatchingGiftOptions()
     * @param \patest\ArrayType\ArrayOfMatchingGiftOptionRelationshipDetail $globalGrantingRelationships
     * @param \patest\ArrayType\ArrayOfMatchingGiftOption $matchingGiftOptions
     */
    public function __construct(\patest\ArrayType\ArrayOfMatchingGiftOptionRelationshipDetail $globalGrantingRelationships = null, \patest\ArrayType\ArrayOfMatchingGiftOption $matchingGiftOptions = null)
    {
        $this
            ->setGlobalGrantingRelationships($globalGrantingRelationships)
            ->setMatchingGiftOptions($matchingGiftOptions);
    }
    /**
     * Get GlobalGrantingRelationships 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\ArrayOfMatchingGiftOptionRelationshipDetail|null
     */
    public function getGlobalGrantingRelationships()
    {
        return isset($this->GlobalGrantingRelationships) ? $this->GlobalGrantingRelationships : null;
    }
    /**
     * Set GlobalGrantingRelationships 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\ArrayOfMatchingGiftOptionRelationshipDetail $globalGrantingRelationships
     * @return \patest\StructType\SearchForMatchingGiftsOptions_Response
     */
    public function setGlobalGrantingRelationships(\patest\ArrayType\ArrayOfMatchingGiftOptionRelationshipDetail $globalGrantingRelationships = null)
    {
        if (is_null($globalGrantingRelationships) || (is_array($globalGrantingRelationships) && empty($globalGrantingRelationships))) {
            unset($this->GlobalGrantingRelationships);
        } else {
            $this->GlobalGrantingRelationships = $globalGrantingRelationships;
        }
        return $this;
    }
    /**
     * Get MatchingGiftOptions 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\ArrayOfMatchingGiftOption|null
     */
    public function getMatchingGiftOptions()
    {
        return isset($this->MatchingGiftOptions) ? $this->MatchingGiftOptions : null;
    }
    /**
     * Set MatchingGiftOptions 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\ArrayOfMatchingGiftOption $matchingGiftOptions
     * @return \patest\StructType\SearchForMatchingGiftsOptions_Response
     */
    public function setMatchingGiftOptions(\patest\ArrayType\ArrayOfMatchingGiftOption $matchingGiftOptions = null)
    {
        if (is_null($matchingGiftOptions) || (is_array($matchingGiftOptions) && empty($matchingGiftOptions))) {
            unset($this->MatchingGiftOptions);
        } else {
            $this->MatchingGiftOptions = $matchingGiftOptions;
        }
        return $this;
    }
}
