<?php
$GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_d52e11ed6622048b96" . "01ec2bd5d6224b" => base64_decode("ZXZlbnRfdGltZQ=" . "="), "_6e38cb9e0" . "43a07cd69a" . "1711a6704c" . "62a" => base64_decode("cGF" . "yZW" . "50X" . "2lk"), "_db6f0ba079" . "1e9a6354076" . "59a9fe04e40" => base64_decode("aXNfb2Jq" . "ZWN0"), "_0bbada826" . "c50b0078f3" . "0c38c70714" . "c6b" => base64_decode("SU5TRVJUIElOVE8gRVJNU19vYmplY3RzX2V2ZW50cyAoYWdncmVnYXRpb24sIG9iamVjdF9pZCwgc" . "GFyZW50X2lkLCBldmVudF9jb2RlLCBldmVudF90aW1lKSBWQUxVRVMgKGludDphZ2dyZWdhdGlvbi" . "wgaW50Om9iamVjdF9pZCwgaW50OnBhcmVudF9pZCwgc3RyOmVjb2RlLCBpbnQ6ZXZlbnRfdGltZSk" . "="), "agg" . "reg" . "ati" . "on" => base64_decode("YWdn" . "cmVn" . "YXRp" . "b24="), "_c336a736f98472e69eb00017dda5a1" . "7e" => base64_decode("dHJpZ2dlcl9lcnJ" . "vcg=="), "_4417a5fedb4c" . "5a3337d215c03" . "c06a8ea" => base64_decode("REVMRVRFIEZST00gRVJNU19vYmplY3RzX2V2ZW50cyBXSEVSRSBldmVudF9jb2RlIGVxOnN0cjplY29kZSBBTkQgb2JqZWN0X2lkID0gaW50Om9iamVjdF9pZCBBTkQgYWdncmVnYXRpb24gPSBpbnQ6YWd" . "ncmVnYXRpb24gQU5EIHBhcmVudF9pZCA9IGludDpwYXJlbnRfaWQ="), "_c5eb4e7a08c3ad983e3" . "3b7ea72cd01de" => base64_decode("ZXZlbn" . "RfY29k" . "ZQ=="), "_9772fb9a080ebd321ff" . "a8dde1ad8b616" => base64_decode("U2V0T2JqZWN0IGNhb" . "GxlZCB3aXRoIG5vbi" . "1vYmplY3Q="), "_84a0a682917e41acbf599b8f75bb" . "3754" => base64_decode("U0VMRUNUICogRlJPTSBFUk1TX29iamVjdHNfZXZlbnRzIFdIRVJFIGFnZ3JlZ2F0aW9uID0gaW50OmFnZ3JlZ2F0aW9uIEFORCBvYmplY3RfaWQgPSBpbnQ6b2Jq" . "ZWN0X2lkIEFORCBldmVudF9jb2RlIGVxOnN0cjplY29kZQ=="), "obje" . "ct_i" . "d" => base64_decode("b2JqZWN0X2l" . "k"));
use Claromentis\Core\DAL;
class ERMSObjectEvent extends ERMSEvent
{
    protected $object_id;
    protected $aggregation;
    protected $event_time;
    protected $parent_id = 0;
    
    
    
    
    
    
    public function __construct($event)
    {
        $this->code = $event->code;
        $this->name = $event->name;
    }
    
    
    
    
    
    
    
    public function Load($_01ae63927cddbad58fea82ff8663c880)
    {
        global $db;
        if (!$_01ae63927cddbad58fea82ff8663c880) {
            return false;
        }
        $object_id = $_01ae63927cddbad58fea82ff8663c880->GetID();
        $aggregation = $_01ae63927cddbad58fea82ff8663c880->GetAggregation();
        $_1b4e93bb4d445b083d9fcb016416a70d = new DAL\Query($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_84a0a682917e4" . "1acbf599b8f75b" . "b3754"], $aggregation, $object_id, $this->code);
        $_1f24efd4735b7a11b391147435e7d35d = $db->query($_1b4e93bb4d445b083d9fcb016416a70d);
        if ($_b8cfc2e06d9d1fec1893ea4a054002bf = $_1f24efd4735b7a11b391147435e7d35d->fetchArray()) {
            $this->code = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_c5eb4e7a08c3ad983e33" . "b7ea72cd01de"]];
            $this->object_id = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["ob" . "je" . "ct" . "_i" . "d"]];
            $this->aggregation = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["aggr" . "egat" . "ion"]];
            $this->event_time = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_d52e11ed6622048b96" . "01ec2bd5d6224b"]];
            $this->parent_id = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_6e38cb9e04" . "3a07cd69a17" . "11a6704c62a"]];
            return true;
        }
        return false;
    }
    function SetObject($_01ae63927cddbad58fea82ff8663c880)
    {
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_db6f0ba0791e9a6" . "35407659a9fe04e4" . "0"]($_01ae63927cddbad58fea82ff8663c880)) {
            $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_c336a736f98472e69eb0001" . "7dda5a17e"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_9772fb9a080ebd321ff" . "a8dde1ad8b616"]);
        }
        
        
        $this->object_id = $_01ae63927cddbad58fea82ff8663c880->GetID();
        $this->aggregation = $_01ae63927cddbad58fea82ff8663c880->GetAggregation();
        if ($_01ae63927cddbad58fea82ff8663c880->parent_id) {
            $this->parent_id = $_01ae63927cddbad58fea82ff8663c880->parent_id;
        }
    }
    function GetObject()
    {
        global $g_erms_browser;
        return $g_erms_browser->GetERMSObject($this->object_id, $this->aggregation, $this->parent_id);
    }
    function SetEventTime($_c8b38c7133c2e8460c1cca42230ac6c2)
    {
        $this->event_time = $_c8b38c7133c2e8460c1cca42230ac6c2;
    }
    function GetEventTime()
    {
        return $this->event_time;
    }
    function SetParentID($_6e38cb9e043a07cd69a1711a6704c62a)
    {
        $this->parent_id = $_6e38cb9e043a07cd69a1711a6704c62a;
    }
    public function Save()
    {
        $db = Claromentis\Core\Services::I()->GetDb();
        $db->query($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_4417a5fe" . "db4c5a333" . "7d215c03c" . "06a8ea"], $this->code, $this->object_id, $this->aggregation, $this->parent_id);
        $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_0bbada826c50b0078" . "f30c38c70714c6b"], $this->aggregation, $this->object_id, $this->parent_id, $this->code, $this->event_time);
    }
    function Init(&$_01ae63927cddbad58fea82ff8663c880)
    {
        if (!$this->Load($_01ae63927cddbad58fea82ff8663c880)) {
            $this->SetObject($_01ae63927cddbad58fea82ff8663c880);
        }
    }
    function Unlink()
    {
        $db = Claromentis\Core\Services::I()->GetDb();
        $_1b4e93bb4d445b083d9fcb016416a70d = new DAL\Query($GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_4417a5fedb4c5" . "a3337d215c03c0" . "6a8ea"], $this->code, $this->object_id, $this->aggregation, $this->parent_id);
        $db->query($_1b4e93bb4d445b083d9fcb016416a70d);
    }
}