File "unitecreator_dataset.class.php"

Full path: /home/kosmetik/public_html/wp-content/plugins/unlimited-elements-for-elementor/inc_php/unitecreator_dataset.class.php
File size: 1.33 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php

defined('UNLIMITED_ELEMENTS_INC') or die('Restricted access');
class UniteCreatorDataset
{
    public static $arrDatasetTypes = array();
    public static $arrTypeNames = array();
    private function getArrQueryShort($arrQueries)
    {
        $arrShort = array();
        foreach ($arrQueries as $name => $arrQuery) {
            $title = UniteFunctionsUC::getVal($arrQuery, "title");
            $arrShort[$name] = $title;
        }
        return $arrShort;
    }
    public function registerDataset($type, $title, $arrQueries)
    {
        if (isset(self::$arrDatasetTypes[$type])) {
            UniteFunctionsUC::throwError("Dataset type is already exists");
        }
        $arrDataset = array();
        $arrDataset["title"] = $title;
        $arrDataset["queries"] = $arrQueries;
        self::$arrDatasetTypes[$type] = $arrDataset;
        self::$arrTypeNames[$type] = $title;
    }
    public function getDatasetTypes()
    {
        return self::$arrDatasetTypes;
    }
    public function getDatasetTypeNames()
    {
        return self::$arrTypeNames;
    }
    public function getDataset($type)
    {
        if (!isset(self::$arrDatasetTypes[$type])) {
            UniteFunctionsUC::throwError("The dataset type: {$type} not exists");
        }
        $arrDataset = self::$arrDatasetTypes[$type];
        return $arrDataset;
    }
}