<?php

namespace CustomerManagement\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ClockFailure StructType
 * @subpackage Structs
 */
class ClockFailure extends AbstractStructBase
{
    /**
     * The ClockFaultAllowance
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var int
     */
    public $ClockFaultAllowance;
    /**
     * The HasTroubleCondition
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var bool
     */
    public $HasTroubleCondition;
    /**
     * The PanelTimeUtc
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: true
     * @var string
     */
    public $PanelTimeUtc;
    /**
     * The BackendTimeUtc
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: true
     * @var string
     */
    public $BackendTimeUtc;
    /**
     * Constructor method for ClockFailure
     * @uses ClockFailure::setClockFaultAllowance()
     * @uses ClockFailure::setHasTroubleCondition()
     * @uses ClockFailure::setPanelTimeUtc()
     * @uses ClockFailure::setBackendTimeUtc()
     * @param int $clockFaultAllowance
     * @param bool $hasTroubleCondition
     * @param string $panelTimeUtc
     * @param string $backendTimeUtc
     */
    public function __construct($clockFaultAllowance = null, $hasTroubleCondition = null, $panelTimeUtc = null, $backendTimeUtc = null)
    {
        $this
            ->setClockFaultAllowance($clockFaultAllowance)
            ->setHasTroubleCondition($hasTroubleCondition)
            ->setPanelTimeUtc($panelTimeUtc)
            ->setBackendTimeUtc($backendTimeUtc);
    }
    /**
     * Get ClockFaultAllowance value
     * @return int
     */
    public function getClockFaultAllowance()
    {
        return $this->ClockFaultAllowance;
    }
    /**
     * Set ClockFaultAllowance value
     * @param int $clockFaultAllowance
     * @return \CustomerManagement\StructType\ClockFailure
     */
    public function setClockFaultAllowance($clockFaultAllowance = null)
    {
        // validation for constraint: int
        if (!is_null($clockFaultAllowance) && !(is_int($clockFaultAllowance) || ctype_digit($clockFaultAllowance))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($clockFaultAllowance, true), gettype($clockFaultAllowance)), __LINE__);
        }
        $this->ClockFaultAllowance = $clockFaultAllowance;
        return $this;
    }
    /**
     * Get HasTroubleCondition value
     * @return bool
     */
    public function getHasTroubleCondition()
    {
        return $this->HasTroubleCondition;
    }
    /**
     * Set HasTroubleCondition value
     * @param bool $hasTroubleCondition
     * @return \CustomerManagement\StructType\ClockFailure
     */
    public function setHasTroubleCondition($hasTroubleCondition = null)
    {
        // validation for constraint: boolean
        if (!is_null($hasTroubleCondition) && !is_bool($hasTroubleCondition)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($hasTroubleCondition, true), gettype($hasTroubleCondition)), __LINE__);
        }
        $this->HasTroubleCondition = $hasTroubleCondition;
        return $this;
    }
    /**
     * Get PanelTimeUtc value
     * @return string
     */
    public function getPanelTimeUtc()
    {
        return $this->PanelTimeUtc;
    }
    /**
     * Set PanelTimeUtc value
     * @param string $panelTimeUtc
     * @return \CustomerManagement\StructType\ClockFailure
     */
    public function setPanelTimeUtc($panelTimeUtc = null)
    {
        // validation for constraint: string
        if (!is_null($panelTimeUtc) && !is_string($panelTimeUtc)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($panelTimeUtc, true), gettype($panelTimeUtc)), __LINE__);
        }
        $this->PanelTimeUtc = $panelTimeUtc;
        return $this;
    }
    /**
     * Get BackendTimeUtc value
     * @return string
     */
    public function getBackendTimeUtc()
    {
        return $this->BackendTimeUtc;
    }
    /**
     * Set BackendTimeUtc value
     * @param string $backendTimeUtc
     * @return \CustomerManagement\StructType\ClockFailure
     */
    public function setBackendTimeUtc($backendTimeUtc = null)
    {
        // validation for constraint: string
        if (!is_null($backendTimeUtc) && !is_string($backendTimeUtc)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($backendTimeUtc, true), gettype($backendTimeUtc)), __LINE__);
        }
        $this->BackendTimeUtc = $backendTimeUtc;
        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 \CustomerManagement\StructType\ClockFailure
     */
    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__;
    }
}
