<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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