<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TimePeriodByHour StructType
 * @subpackage Structs
 */
class TimePeriodByHour extends TimePeriodOfDay
{
    /**
     * The startTimeOfPeriod
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $startTimeOfPeriod;
    /**
     * The endTimeOfPeriod
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $endTimeOfPeriod;
    /**
     * The timePeriodByHourExtension
     * Meta informations extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\ExtensionType
     */
    public $timePeriodByHourExtension;
    /**
     * Constructor method for TimePeriodByHour
     * @uses TimePeriodByHour::setStartTimeOfPeriod()
     * @uses TimePeriodByHour::setEndTimeOfPeriod()
     * @uses TimePeriodByHour::setTimePeriodByHourExtension()
     * @param string $startTimeOfPeriod
     * @param string $endTimeOfPeriod
     * @param \StructType\ExtensionType $timePeriodByHourExtension
     */
    public function __construct($startTimeOfPeriod = null, $endTimeOfPeriod = null, \StructType\ExtensionType $timePeriodByHourExtension = null)
    {
        $this
            ->setStartTimeOfPeriod($startTimeOfPeriod)
            ->setEndTimeOfPeriod($endTimeOfPeriod)
            ->setTimePeriodByHourExtension($timePeriodByHourExtension);
    }
    /**
     * Get startTimeOfPeriod value
     * @return string
     */
    public function getStartTimeOfPeriod()
    {
        return $this->startTimeOfPeriod;
    }
    /**
     * Set startTimeOfPeriod value
     * @param string $startTimeOfPeriod
     * @return \StructType\TimePeriodByHour
     */
    public function setStartTimeOfPeriod($startTimeOfPeriod = null)
    {
        // validation for constraint: string
        if (!is_null($startTimeOfPeriod) && !is_string($startTimeOfPeriod)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($startTimeOfPeriod)), __LINE__);
        }
        $this->startTimeOfPeriod = $startTimeOfPeriod;
        return $this;
    }
    /**
     * Get endTimeOfPeriod value
     * @return string
     */
    public function getEndTimeOfPeriod()
    {
        return $this->endTimeOfPeriod;
    }
    /**
     * Set endTimeOfPeriod value
     * @param string $endTimeOfPeriod
     * @return \StructType\TimePeriodByHour
     */
    public function setEndTimeOfPeriod($endTimeOfPeriod = null)
    {
        // validation for constraint: string
        if (!is_null($endTimeOfPeriod) && !is_string($endTimeOfPeriod)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($endTimeOfPeriod)), __LINE__);
        }
        $this->endTimeOfPeriod = $endTimeOfPeriod;
        return $this;
    }
    /**
     * Get timePeriodByHourExtension value
     * @return \StructType\ExtensionType|null
     */
    public function getTimePeriodByHourExtension()
    {
        return $this->timePeriodByHourExtension;
    }
    /**
     * Set timePeriodByHourExtension value
     * @param \StructType\ExtensionType $timePeriodByHourExtension
     * @return \StructType\TimePeriodByHour
     */
    public function setTimePeriodByHourExtension(\StructType\ExtensionType $timePeriodByHourExtension = null)
    {
        $this->timePeriodByHourExtension = $timePeriodByHourExtension;
        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\TimePeriodByHour
     */
    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__;
    }
}
