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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] ?: array()) + array("_aed8da0f190" . "91214b78f803" . "51048517c" => base64_decode("c3Ryb" . "GVu"), "_62d701c3c53404f06345eb35720" . "a47b4" => base64_decode("aXNfbnVt" . "ZXJpYw=="), "_aaabebe7ea4dcd24a8e" . "6b36cfe511422" => base64_decode("VV" . "RD"), "_cfe3120f54395b670652b" . "38c2d0a8e88" => base64_decode("c3Vic" . "3Ry"));
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["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_cfe3120f5" . "4395b67065" . "2b38c2d0a8" . "e88"]($_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["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_aaabebe7ea4dcd24a8e6b36cfe511" . "422"]));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setHour($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_cfe3120f54395b67065" . "2b38c2d0a8e88"]($value, 0, 2));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setMinute($GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_cfe3120f54395b670652b" . "38c2d0a8e88"]($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["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_aed8da0f19091214b78f8035104" . "8517c"]($value) === 4 && $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_62d701c3c53404f06345" . "eb35720a47b4"]($value)) {
            $value = $this->Unserialize($value);
        }
        return $value;
    }
    public function Modify($_fd536f3a4b49ad5514a4e7a5db1c6248, $_33e21c745c95d91261fc8f7b4b930af0)
    {
        return $this->Normalize($_33e21c745c95d91261fc8f7b4b930af0);
    }
}