<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for LifeCycleManagement StructType
 * @subpackage Structs
 */
class LifeCycleManagement extends AbstractStructBase
{
    /**
     * The cancel
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var bool
     */
    public $cancel;
    /**
     * The end
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var bool
     */
    public $end;
    /**
     * The lifeCycleManagementExtension
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\ExtensionType
     */
    public $lifeCycleManagementExtension;
    /**
     * Constructor method for LifeCycleManagement
     * @uses LifeCycleManagement::setCancel()
     * @uses LifeCycleManagement::setEnd()
     * @uses LifeCycleManagement::setLifeCycleManagementExtension()
     * @param bool $cancel
     * @param bool $end
     * @param \StructType\ExtensionType $lifeCycleManagementExtension
     */
    public function __construct($cancel = null, $end = null, \StructType\ExtensionType $lifeCycleManagementExtension = null)
    {
        $this
            ->setCancel($cancel)
            ->setEnd($end)
            ->setLifeCycleManagementExtension($lifeCycleManagementExtension);
    }
    /**
     * Get cancel value
     * @return bool|null
     */
    public function getCancel()
    {
        return $this->cancel;
    }
    /**
     * Set cancel value
     * @param bool $cancel
     * @return \StructType\LifeCycleManagement
     */
    public function setCancel($cancel = null)
    {
        // validation for constraint: boolean
        if (!is_null($cancel) && !is_bool($cancel)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($cancel)), __LINE__);
        }
        $this->cancel = $cancel;
        return $this;
    }
    /**
     * Get end value
     * @return bool|null
     */
    public function getEnd()
    {
        return $this->end;
    }
    /**
     * Set end value
     * @param bool $end
     * @return \StructType\LifeCycleManagement
     */
    public function setEnd($end = null)
    {
        // validation for constraint: boolean
        if (!is_null($end) && !is_bool($end)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($end)), __LINE__);
        }
        $this->end = $end;
        return $this;
    }
    /**
     * Get lifeCycleManagementExtension value
     * @return \StructType\ExtensionType|null
     */
    public function getLifeCycleManagementExtension()
    {
        return $this->lifeCycleManagementExtension;
    }
    /**
     * Set lifeCycleManagementExtension value
     * @param \StructType\ExtensionType $lifeCycleManagementExtension
     * @return \StructType\LifeCycleManagement
     */
    public function setLifeCycleManagementExtension(\StructType\ExtensionType $lifeCycleManagementExtension = null)
    {
        $this->lifeCycleManagementExtension = $lifeCycleManagementExtension;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \StructType\LifeCycleManagement
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
