<?php
namespace Claromentis\People\Validator;

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"] ?: array()) + array("_bb26699a673361ff7c17444a2a82d" . "eba" => base64_decode("SW52YWxpZCB2YWx1ZSBnaXZlbiB" . "mb3IgZG9jdW1lbnQgbGluayBmaW" . "VsZCA="), "_d155d43" . "a39de93f" . "858123c6" . "b6ce31d8" . "a" => base64_decode("cHJl" . "Z19t" . "YXRj" . "aA=="), "_ac927f4168510971a59508" . "f1f08cf98a" => base64_decode("L15" . "cZH" . "s4f" . "SQv"), "_bd71c3b5c201fc" . "11db82ed14ce424" . "de5" => base64_decode("aW5f" . "YXJy" . "YXk="), "_3aec16c1a" . "a2104da778" . "e412207d6c" . "415" => base64_decode("L15cZHsxNH" . "18XGR7OH0k" . "Lw=="), "_62d701c3c53404f0634" . "5eb35720a47b4" => base64_decode("aXNf" . "bnVt" . "ZXJp" . "Yw=="), "_d013620d4b36b1d03509c" . "beff31bbdb9" => base64_decode("IiBnaXZlbiBmb3Ig" . "bnVtZXJpYyBmaWVs" . "ZCA="), "_4b4a03dbe69a" . "4c39db014be28" . "75a7313" => base64_decode("Tm9uLW51bWVyaWMgdmFsdWUgIg" . "=="), "_fa96cdf5" . "8bff3b069" . "5fb2bc080" . "3d7b12" => base64_decode("IGRvZ" . "XMgbm" . "90IGV" . "4aXN0"), "_a827c5bc10b88ccab760d95" . "c58bfbeaa" => base64_decode("Q291bGQgbm90IHB" . "hcnNlIHZhbHVlIC" . "I="), "_dc99f29eb97c274b" . "4e47f6701fb2d842" => base64_decode("TWV0Y" . "WRhdG" . "EgZml" . "lbGQg"), "_a7fdbac2" . "a6d0ebb5b" . "b8ea569e8" . "173d7b" => base64_decode("IiBmb3IgZGF0" . "ZSBmaWVsZCA="), "_535e3fcb3f5d89c525bb618" . "a08cc8dcc" => base64_decode("LiBWYWx1ZSBtdXN0IGJlIGVpdGhlciBhIGRvY3VtZW50IElEIG9yIGEgZG9" . "jdW1lbnQgb2JqZWN0"), "_27ba77e349cbe14" . "4e8794d0c0497a10" . "6" => base64_decode("IiBnaXZlbiBmb3Igc2" . "VsZWN0IGZpZWxkIA=="), "_66a6b98e1f1601e30de10fe" . "b344fcdb6" => base64_decode("SW52YWxpZCB2YWx1" . "ZSAi"), "_2cb499b451eb718f841aaa" . "78dc70cc52" => base64_decode("IiBmb3IgZG" . "F0ZS10aW1l" . "IGZpZWxkIA" . "=="));
use Claromentis\People\Exception\ValidationException;
use Claromentis\People\Repository\UserRepository;
class MetadataValidator
{
    protected $user_repository;
    public function __construct(UserRepository $_eeeeb0d673b7b0fd0bdca58b5541c3e0)
    {
        $this->user_repository = $_eeeeb0d673b7b0fd0bdca58b5541c3e0;
    }
    
    
    
    
    
    
    
    public function Validate(int $_8bd60f167b34bb2f633dd93934749b67, array $values) : array
    {
        $_cd32cee6e5836ae05dc7b722f2ec21e9 = new \MetaDataSet($_8bd60f167b34bb2f633dd93934749b67);
        $_cd32cee6e5836ae05dc7b722f2ec21e9->LoadAllFields();
        $output = [];
        foreach ($values as $key => $value) {
            $field = $_cd32cee6e5836ae05dc7b722f2ec21e9->GetMetaFieldByName($key);
            if ($field === false) {
                throw new ValidationException($GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_dc99f29eb97c274b4e47f6701fb2" . "d842"] . $key . $GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_fa96cdf58bff3b0695fb" . "2bc0803d7b12"]);
            }
            switch ($field->GetMetaType()) {
                case META_TYPE_TEXT:
                case META_TYPE_DEFAULT:
                    break;
                case META_TYPE_INT:
                    if (!$GLOBALS["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_62d701c3c53404f06345eb357" . "20a47b4"]($value)) {
                        throw new ValidationException($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_4b4a03dbe69a4c39db014be" . "2875a7313"] . $value . $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_d013620d" . "4b36b1d03" . "509cbeff3" . "1bbdb9"] . $key);
                    }
                    break;
                case META_TYPE_DATETIME:
                    if (!$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_d155d43a39de93f" . "858123c6b6ce31d8" . "a"]($GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_3aec16c1aa2104da" . "778e412207d6c415"], $value)) {
                        throw new ValidationException($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_a827c5bc10b88cca" . "b760d95c58bfbeaa"] . $value . $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_2cb499b451eb718f841aaa78dc70c" . "c52"] . $key);
                    }
                    break;
                case META_TYPE_SELECT:
                    $field->values->Load();
                    $_4d67cdd33a7358d7cc3b5e51df410bbb = $field->values->GetAllValues();
                    if (!$GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_bd71c3b5c201fc11db82ed14" . "ce424de5"]($value, $_4d67cdd33a7358d7cc3b5e51df410bbb)) {
                        throw new ValidationException($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_66a6b98e1f1601e30de10feb344" . "fcdb6"] . $value . $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_27ba77e349cbe14" . "4e8794d0c0497a10" . "6"] . $key);
                    }
                    break;
                case META_TYPE_CHECK:
                    break;
                case META_TYPE_DOCLINK:
                    if (!$GLOBALS["__65da1b1ec2d6653e8a0ab784" . "8e536215"]["_62d701c3c53404f06345eb35720a4" . "7b4"]($value) && !$value instanceof \ERMSDocument && !$value instanceof \Claromentis\Core\Metadata\Type\DocumentObject) {
                        throw new ValidationException($GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_bb26699a6733" . "61ff7c17444a2" . "a82deba"] . $key . $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_535e3fc" . "b3f5d89c" . "525bb618" . "a08cc8dc" . "c"]);
                    }
                    break;
                case META_TYPE_LINK:
                    break;
                case META_TYPE_USER:
                    break;
                case META_TYPE_DATE:
                    if (!$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_d155d43a39de93f85" . "8123c6b6ce31d8a"]($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_ac927f4168510971" . "a59508f1f08cf98a"], $value)) {
                        throw new ValidationException($GLOBALS["__65da1b1ec2d6653e" . "8a0ab7848e536215"]["_a827c5bc10b88ccab760" . "d95c58bfbeaa"] . $value . $GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_a7fdbac2a6d0ebb5bb" . "8ea569e8173d7b"] . $key);
                    }
                    break;
                case META_TYPE_SPECIAL:
                    break;
                case META_TYPE_FILE:
                    break;
                case META_TYPE_ADDRESS:
                    break;
                case META_TYPE_MULTISELECT:
                    break;
                case META_TYPE_DATE_NO_YEAR:
                    break;
                case META_TYPE_IMAGE:
                    break;
            }
            $output[$key] = $value;
        }
    }
}