<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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