<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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