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

$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] ?: array()) + array("_aed8da0f19091214b78f80" . "351048517c" => base64_decode("c3Ryb" . "GVu"), "_67a0d624aebc" . "ceb0abd5ce56a" . "53ff06f" => base64_decode("ZGF0ZQ" . "=="), "_7f628626dd1d55c71b1fc0932f" . "fd1d2c" => base64_decode("aXNfYXJ" . "yYXk="), "_5e30c4717ced36c" . "ff9e93e19a5c576c" . "c" => base64_decode("aXNfc3" . "RyaW5n"), "_c8b38c7133c2e8460c1c" . "ca42230ac6c2" => base64_decode("dGlt" . "ZQ=="));
use Claromentis\Core\Date\DateFormatter;




class TypeDateTime implements ValueType
{
    
    
    
    
    
    
    
    
    public function Serialize($value)
    {
        if ($value === null) {
            return null;
        }
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_7f628626dd1d55c71b1fc0932ff" . "d1d2c"]($value)) {
            $_67a0d624aebcceb0abd5ce56a53ff06f = \Date::CreateFrom($value[$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"]["_67a0d624aebcceb0abd5ce5" . "6a53ff06f"]], $value[$GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_c8b38c71" . "33c2e8460" . "c1cca4223" . "0ac6c2"]]);
        } else {
            $_67a0d624aebcceb0abd5ce56a53ff06f = \Date::CreateFrom($value->date, $value->time);
        }
        if (!$_67a0d624aebcceb0abd5ce56a53ff06f) {
            throw new \Exception();
        }
        
        
        $_0dbe978d64aca9dbe1aa157ff74b5602 = (string) $_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DATE_FORMAT_TIMESTAMP);
        return $_0dbe978d64aca9dbe1aa157ff74b5602;
    }
    public function Unserialize($value)
    {
        if (empty($value)) {
            return null;
        }
        $_67a0d624aebcceb0abd5ce56a53ff06f = new \Date($value);
        return [$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_67a0d624aebcc" . "eb0abd5ce56a53" . "ff06f"] => $_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DateFormatter::SHORT_DATE), $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_c8b38c7133c2e8460c1c" . "ca42230ac6c2"] => $_67a0d624aebcceb0abd5ce56a53ff06f->getDate(DATE_FORMAT_CLA_TIME)];
    }
    public function Normalize($value)
    {
        if ($value === null) {
            return null;
        }
        if ($GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_5e30c4717" . "ced36cff9e" . "93e19a5c57" . "6cc"]($value) && $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_aed8da0f19091214b78f803510485" . "17c"]($value) === 14) {
            $value = $this->Unserialize($value);
        }
        return $value;
    }
    public function Modify($_fd536f3a4b49ad5514a4e7a5db1c6248, $_33e21c745c95d91261fc8f7b4b930af0)
    {
        return $this->Normalize($_33e21c745c95d91261fc8f7b4b930af0);
    }
}