<?php
namespace Claromentis\Documents\Subscriber;

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_73b71502ed6" . "3c154d31898e" . "0fd6357be" => base64_decode("Y2ZnX3Jldmlld19" . "kYXRlX21ldGFkYX" . "Rh"), "_6e646b6b30b2486e53964296cbc8c" . "c7a" => base64_decode("ZG9jX3Jl" . "dmlld19y" . "ZW1pbmRl" . "cl9zZW50"), "_ea964bbedfcf7e579" . "dcabce637ab6dae" => base64_decode("Y2hlY2tSZXZpZXdEYX" . "RlUmVtaW5kZXI="));
use Claromentis\Core\Config\Config;
use Claromentis\Documents\Event\DocumentEventType;
use Claromentis\Documents\Event\UpdateDocumentEvent;
use Claromentis\Documents\Event\UpdateFolderEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Date;
use ERMSMetaData;
use ERMSObject;
class ReviewDateSubscriber implements EventSubscriberInterface
{
    private Config $config;
    
    
    
    
    public function __construct(Config $config)
    {
        $this->config = $config;
    }
    public static function getSubscribedEvents()
    {
        return [DocumentEventType::UPDATE_DOCUMENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_ea964bbedfcf7e579dcab" . "ce637ab6dae"], DocumentEventType::UPDATE_FOLDER => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_ea964bbedfcf7e57" . "9dcabce637ab6dae"]];
    }
    
    
    
    
    
    
    
    public function checkReviewDateReminder($event)
    {
        
        
        
        
        $_f656816961e8573806141c558b184fe2 = $event->getSubject();
        
        
        
        
        $_b255ebafd5b8bb45110cd2db0604fa44 = $event->GetMetadata();
        
        
        
        
        $_cf209af9773aefa8d9b548a33775ebe1 = $event->GetPrevMetadata();
        if (empty($_b255ebafd5b8bb45110cd2db0604fa44) || empty($_cf209af9773aefa8d9b548a33775ebe1)) {
            return;
        }
        $_bb6df02350fdbba574b2b131f7023ace = $this->config->get($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_73b71502ed63c154d31898e0" . "fd6357be"]);
        $_cbd6d32c5f1a1923f05470d426b1207a = $_b255ebafd5b8bb45110cd2db0604fa44->GetValue($_bb6df02350fdbba574b2b131f7023ace);
        $_16cb291a6c473d1ddb10aa4a488ec9e7 = $_b255ebafd5b8bb45110cd2db0604fa44->GetPrototype($_bb6df02350fdbba574b2b131f7023ace)->GetMetaType();
        $_922c15698e82e668579f7e8bd983f956 = $_cf209af9773aefa8d9b548a33775ebe1->GetValue($_bb6df02350fdbba574b2b131f7023ace);
        if (empty($_cbd6d32c5f1a1923f05470d426b1207a) || empty($_922c15698e82e668579f7e8bd983f956)) {
            return;
        }
        $_33127efdccedc7aeaf99f07a4f0241bf = new Date();
        if ($_16cb291a6c473d1ddb10aa4a488ec9e7 == META_TYPE_DATE) {
            $_33127efdccedc7aeaf99f07a4f0241bf->toUTC();
            $_33127efdccedc7aeaf99f07a4f0241bf->setTime(0, 0);
        }
        if ($_cbd6d32c5f1a1923f05470d426b1207a->getDate(DATE_FORMAT_TIMESTAMP) != $_922c15698e82e668579f7e8bd983f956->getDate(DATE_FORMAT_TIMESTAMP)) {
            $_a7abaf075f95e6b212a94c1c739d6e57 = $_cbd6d32c5f1a1923f05470d426b1207a->getDate(DATE_FORMAT_TIMESTAMP) >= $_33127efdccedc7aeaf99f07a4f0241bf->getDate(DATE_FORMAT_TIMESTAMP);
            $_f656816961e8573806141c558b184fe2->metadata->SetValue($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_6e646b6b30b2486e53964296cbc8c" . "c7a"], $_a7abaf075f95e6b212a94c1c739d6e57 ? 0 : 1);
            $_f656816961e8573806141c558b184fe2->metadata->SaveValue($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_6e646b6b30b2486e53964296cbc8cc7" . "a"]);
        }
    }
}