<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for BizResource.CalendarDayHour StructType
 * @subpackage Structs
 */
class BizResource_CalendarDayHour extends AnyEntity
{
    /**
     * The Day
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Day;
    /**
     * The Hour
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $Hour;
    /**
     * Constructor method for BizResource.CalendarDayHour
     * @uses BizResource_CalendarDayHour::setDay()
     * @uses BizResource_CalendarDayHour::setHour()
     * @param string $day
     * @param string $hour
     */
    public function __construct($day = null, $hour = null)
    {
        $this
            ->setDay($day)
            ->setHour($hour);
    }
    /**
     * Get Day 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 getDay()
    {
        return isset($this->Day) ? $this->Day : null;
    }
    /**
     * Set Day 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 $day
     * @return \patest\StructType\BizResource_CalendarDayHour
     */
    public function setDay($day = null)
    {
        // validation for constraint: string
        if (!is_null($day) && !is_string($day)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($day, true), gettype($day)), __LINE__);
        }
        if (is_null($day) || (is_array($day) && empty($day))) {
            unset($this->Day);
        } else {
            $this->Day = $day;
        }
        return $this;
    }
    /**
     * Get Hour 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 getHour()
    {
        return isset($this->Hour) ? $this->Hour : null;
    }
    /**
     * Set Hour 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 $hour
     * @return \patest\StructType\BizResource_CalendarDayHour
     */
    public function setHour($hour = null)
    {
        // validation for constraint: string
        if (!is_null($hour) && !is_string($hour)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($hour, true), gettype($hour)), __LINE__);
        }
        if (is_null($hour) || (is_array($hour) && empty($hour))) {
            unset($this->Hour);
        } else {
            $this->Hour = $hour;
        }
        return $this;
    }
}
