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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"] ?: array()) + array("_cfe3120f54395b670652b38c2d" . "0a8e88" => base64_decode("c3Vic3R" . "y"), "_62d701c3c53404f06345eb35720a4" . "7b4" => base64_decode("aXNfbnVtZXJpYw=" . "="), "_aed8da0f19091214b78f80351048517" . "c" => base64_decode("c3RybGV" . "u"), "_aaabebe7ea4dcd24a8e6b36" . "cfe511422" => base64_decode("VVR" . "D"));
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["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_cfe3120f543" . "95b670652b38" . "c2d0a8e88"]($_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["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_aaabebe7ea4dcd24a8e6" . "b36cfe511422"]));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setHour($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"]["_cfe3120f" . "54395b670" . "652b38c2d" . "0a8e88"]($value, 0, 2));
        $_67a0d624aebcceb0abd5ce56a53ff06f->setMinute($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_cfe3120f54395b67" . "0652b38c2d0a8e88"]($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["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_aed8da0f19091214b78f80" . "351048517c"]($value) === 4 && $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_62d701c3c53404f06345eb357" . "20a47b4"]($value)) {
            $value = $this->Unserialize($value);
        }
        return $value;
    }
    public function Modify($_fd536f3a4b49ad5514a4e7a5db1c6248, $_33e21c745c95d91261fc8f7b4b930af0)
    {
        return $this->Normalize($_33e21c745c95d91261fc8f7b4b930af0);
    }
}