<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Facade.BundleRelatedEventsPart StructType
 * @subpackage Structs
 */
class Facade_BundleRelatedEventsPart extends AnyEntity
{
    /**
     * The AllowEventsToOverlap
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var bool
     */
    public $AllowEventsToOverlap;
    /**
     * The Elements
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var \patest\StructType\RecordSetOfFacade_EventBundleElementRecord
     */
    public $Elements;
    /**
     * The StartFrom
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $StartFrom;
    /**
     * Constructor method for Facade.BundleRelatedEventsPart
     * @uses Facade_BundleRelatedEventsPart::setAllowEventsToOverlap()
     * @uses Facade_BundleRelatedEventsPart::setElements()
     * @uses Facade_BundleRelatedEventsPart::setStartFrom()
     * @param bool $allowEventsToOverlap
     * @param \patest\StructType\RecordSetOfFacade_EventBundleElementRecord $elements
     * @param string $startFrom
     */
    public function __construct($allowEventsToOverlap = null, \patest\StructType\RecordSetOfFacade_EventBundleElementRecord $elements = null, $startFrom = null)
    {
        $this
            ->setAllowEventsToOverlap($allowEventsToOverlap)
            ->setElements($elements)
            ->setStartFrom($startFrom);
    }
    /**
     * Get AllowEventsToOverlap 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 bool|null
     */
    public function getAllowEventsToOverlap()
    {
        return isset($this->AllowEventsToOverlap) ? $this->AllowEventsToOverlap : null;
    }
    /**
     * Set AllowEventsToOverlap 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 bool $allowEventsToOverlap
     * @return \patest\StructType\Facade_BundleRelatedEventsPart
     */
    public function setAllowEventsToOverlap($allowEventsToOverlap = null)
    {
        // validation for constraint: boolean
        if (!is_null($allowEventsToOverlap) && !is_bool($allowEventsToOverlap)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($allowEventsToOverlap, true), gettype($allowEventsToOverlap)), __LINE__);
        }
        if (is_null($allowEventsToOverlap) || (is_array($allowEventsToOverlap) && empty($allowEventsToOverlap))) {
            unset($this->AllowEventsToOverlap);
        } else {
            $this->AllowEventsToOverlap = $allowEventsToOverlap;
        }
        return $this;
    }
    /**
     * Get Elements 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\RecordSetOfFacade_EventBundleElementRecord|null
     */
    public function getElements()
    {
        return isset($this->Elements) ? $this->Elements : null;
    }
    /**
     * Set Elements 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\RecordSetOfFacade_EventBundleElementRecord $elements
     * @return \patest\StructType\Facade_BundleRelatedEventsPart
     */
    public function setElements(\patest\StructType\RecordSetOfFacade_EventBundleElementRecord $elements = null)
    {
        if (is_null($elements) || (is_array($elements) && empty($elements))) {
            unset($this->Elements);
        } else {
            $this->Elements = $elements;
        }
        return $this;
    }
    /**
     * Get StartFrom 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 string|null
     */
    public function getStartFrom()
    {
        return isset($this->StartFrom) ? $this->StartFrom : null;
    }
    /**
     * Set StartFrom 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 string $startFrom
     * @return \patest\StructType\Facade_BundleRelatedEventsPart
     */
    public function setStartFrom($startFrom = null)
    {
        // validation for constraint: string
        if (!is_null($startFrom) && !is_string($startFrom)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($startFrom, true), gettype($startFrom)), __LINE__);
        }
        if (is_null($startFrom) || (is_array($startFrom) && empty($startFrom))) {
            unset($this->StartFrom);
        } else {
            $this->StartFrom = $startFrom;
        }
        return $this;
    }
}
