<?php
namespace Claromentis\Core\Component\ValueType;

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"] ?: array()) + array("_aaabebe7ea4dcd24a8e" . "6b36cfe511422" => base64_decode("VVR" . "D"), "_62d701c3c53404f06345eb35720a47" . "b4" => base64_decode("aXNfbnVt" . "ZXJpYw=="), "_cfe3120f54395b670652b38c2" . "d0a8e88" => base64_decode("c3Vic" . "3Ry"), "_aed8da0f19091214b78f8035" . "1048517c" => base64_decode("c3" . "Ry" . "bG" . "Vu"));
use Claromentis\Core\Date\DateFormatter;




class TypeTime implements ValueType
{
    
    
    
    
    
    
    
    
    public function Serialize($value)
    {
        if ($value === null) {
            return null;
        }
        $_67a0d624aebcceb0abd5ce56a53ff06f = new \Date();
        $_67a0d624aebcceb0abd5ce56a53ff06f = \Date::CreateFrom($_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DateFormatter::SHORT_DATE), $value);
        if (!$_67a0d624aebcceb0abd5ce56a53ff06f) {
            throw new \Exception();
        }
        
        
        $_0dbe978d64aca9dbe1aa157ff74b5602 = (string) $_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DATE_FORMAT_TIMESTAMP);
        $_c8b38c7133c2e8460c1cca42230ac6c2 = $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_cfe3120f5439" . "5b670652b38c2" . "d0a8e88"]($_0dbe978d64aca9dbe1aa157ff74b5602, 8, 4);
        return $_c8b38c7133c2e8460c1cca42230ac6c2;
    }
    public function Unserialize($value)
    {
        if (empty($value)) {
            return null;
        }
        $_67a0d624aebcceb0abd5ce56a53ff06f = new \Date();
        $_9e83734deb9316586c45570f0138251c = $_67a0d624aebcceb0abd5ce56a53ff06f->getTimezone();
        $_67a0d624aebcceb0abd5ce56a53ff06f->setTimezone(new \DateTimeZone($GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_aaabebe7ea4dcd24a8e6b36c" . "fe511422"]));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setHour($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_cfe3120f54395b670652b38c2d0a8e8" . "8"]($value, 0, 2));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setMinute($GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_cfe3120f54395b670652b38c" . "2d0a8e88"]($value, 2, 2));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setTimezone($_9e83734deb9316586c45570f0138251c);
        
        
        $_c8b38c7133c2e8460c1cca42230ac6c2 = (string) $_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DATE_FORMAT_CLA_TIME);
        return $_c8b38c7133c2e8460c1cca42230ac6c2;
    }
    public function Normalize($value)
    {
        if ($value === null) {
            return null;
        }
        if ($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_aed8da0f19091214b78f80351048" . "517c"]($value) === 4 && $GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_62d701c3c53404f06" . "345eb35720a47b4"]($value)) {
            $value = $this->Unserialize($value);
        }
        return $value;
    }
    public function Modify($_fd536f3a4b49ad5514a4e7a5db1c6248, $_33e21c745c95d91261fc8f7b4b930af0)
    {
        return $this->Normalize($_33e21c745c95d91261fc8f7b4b930af0);
    }
}