<?php
$GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_2d4b5f427d48c3244c2f195479a6" . "ced7" => base64_decode("Y29tbW9uLm1ldGFkYXRhLmJsYW5rX3ZhbHVlcw=" . "="), "_2d71c655f2a62b" . "5d8b25dbf8acf95" . "2fd" => base64_decode("Q291bGRuJ3QgbG9hZC4gVW5kZ" . "WZpbmVkIG1ldGEgZmllbGQgSU" . "Q="), "_0c5123aa744f69bbc0e8b3ea" . "2f6e847d" => base64_decode("bG1zZw=" . "="), "_80be54d4bf79b1f177a6b4" . "555ae15ab7" => base64_decode("Q291bGRuJ3Qgc2F2ZS4gVW5kZWZpbmVkIG1ldGEgZmllbGQgS" . "UQ="), "_7f628626dd1d55c71b1fc0932" . "ffd1d2c" => base64_decode("aXNfYXJyYX" . "k="), "_d162ad33b44d275ccc6e4b5280" . "b618df" => base64_decode("bWV0YV" . "90ZXh0"), "_4079816faf0560c" . "6877e40230b8b965" . "f" => base64_decode("REVMRVRFIEZST00gRVJNU19tZXRhZGF0YV9ma" . "WVsZF92YWx1ZXMgV0hFUkUgbWV0YWRhdGFfaW" . "Q9aW50Om1ldGFfZmllbGRfaWQ="), "_0926ec1594f048b9fe0aa9aa05b" . "9a243" => base64_decode("Q291bGRuJ3QgZGVsZXRlLiBVbmRlZmluZWQgbWV0YS" . "BmaWVsZCBJRA=="), "_e2e36e1c2215f261368b20d" . "15740847e" => base64_decode("SU5TRVJUIElOVE8gRVJNU19tZXRhZGF0YV9maWVsZF92YWx1ZXMgKG1ldGFkYXRhX2lkLG1ldGFfdmFsdWUsbWV0YV90ZXh0KSBWQUxVRVMgKGlud" . "DptZXRhX2ZpZWxkX2lkLGludDprZXksIHN0cjp2YWwp"), "_516340c618ee12b" . "8bfb13b0d280f269" . "f" => base64_decode("U0VMRUNUIG1ldGFfdGV4dCBGUk9NIEVSTVNfbWV0YWRhdGFfZmllbGRfdmFsdWVzIF" . "dIRVJFIG1ldGFkYXRhX2lkPWludDptZXRhX2ZpZWxkX2lkIE9SREVSIEJZIG1ldGFf" . "dmFsdWU="), "_31767d7ad5" . "8e706dbf47b" . "7a51a0fe6c4" => base64_decode("Y29" . "1bn" . "Q="));





class DynamicMetaFieldValues extends ErrorHandler
{
    var $meta_field_id = 0;
    var $values;
    function __construct($_6e38cb9e043a07cd69a1711a6704c62a = 0)
    {
        $this->meta_field_id = $_6e38cb9e043a07cd69a1711a6704c62a;
        $this->Clear();
    }
    function Clear()
    {
        $this->values = array();
    }
    function Load()
    {
        if (!$this->meta_field_id) {
            return $this->SetErrMsg($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2d71c655f2" . "a62b5d8b25d" . "bf8acf952fd"]);
        }
        $this->Clear();
        $db = \Claromentis\Core\Services::I()->GetDb();
        $_189840d11056515e52402d1412a0b6e4 = $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_516340c61" . "8ee12b8bfb" . "13b0d280f2" . "69f"], $this->meta_field_id);
        if (!$_189840d11056515e52402d1412a0b6e4->hasData()) {
            return false;
        }
        while ($_b8cfc2e06d9d1fec1893ea4a054002bf = $_189840d11056515e52402d1412a0b6e4->fetchArray()) {
            $this->values[] = $_b8cfc2e06d9d1fec1893ea4a054002bf[$GLOBALS["__65da1b1ec2d6653e8a0ab78" . "48e536215"]["_d162ad33b44d275ccc6e4b5280b6" . "18df"]];
        }
        return true;
    }
    function Save()
    {
        if (!$this->meta_field_id) {
            return $this->SetErrMsg($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_80be54d4bf79b1f177a6b455" . "5ae15ab7"]);
        }
        $this->Delete();
        $db = \Claromentis\Core\Services::I()->GetDb();
        foreach ($this->values as $key => $_c96f552040dea8086bf8bdd70059542f) {
            $db->query($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_e2e36e1c2215f2613" . "68b20d15740847e"], $this->meta_field_id, $key, $_c96f552040dea8086bf8bdd70059542f);
        }
        return true;
    }
    function Delete()
    {
        if (!$this->meta_field_id) {
            return $this->SetErrMsg($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_0926ec1594" . "f048b9fe0aa" . "9aa05b9a243"]);
        }
        $db = \Claromentis\Core\Services::I()->GetDb();
        return !!$db->query($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_4079816faf" . "0560c6877e4" . "0230b8b965f"], $this->meta_field_id);
    }
    function GetAllValues()
    {
        return $this->values;
    }
    function SetValues($values)
    {
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_7f628626dd1d55c71b1" . "fc0932ffd1d2c"]($values) || $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_31767d7ad58e" . "706dbf47b7a51" . "a0fe6c4"]($values) == 0) {
            return $this->SetErrMsg($GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_0c5123aa744f69bbc0e8b3ea2f6" . "e847d"]($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2d4b5f427d48c3244c2f195479a6" . "ced7"]));
        }
        $this->values = $values;
        if (!$GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_7f628626dd1d55c71b1fc" . "0932ffd1d2c"]($this->values)) {
            $this->values = array();
        }
        return true;
    }
}