<?php
namespace App\Dashboard\Templates; abstract class BaseAbstract { static protected $instance = []; protected $dashboard = NULL; static public function getInstance(\Engine\Dashboard\GeneralAbstract $dashboard) { $templateClassName = get_called_class(); $dashboardClassName = get_class($dashboard); if (!isset(static::$instance[$templateClassName][$dashboardClassName])) { static::$instance[$templateClassName][$dashboardClassName] = new static($dashboard); } return static::$instance[$templateClassName][$dashboardClassName]; } final protected function __construct(\Engine\Dashboard\GeneralAbstract $dashboard) { $this->dashboard = $dashboard; } public function getDashboard() { return $this->dashboard; } public function saveDashboard() { $storageObj = new \App\Dashboard\Storage\Database(); $storageObj->set(get_class($this->dashboard), $this->dashboard); } public function getName() { \App\Loader_Lang::getInstance()->loadAppFile("_customLoad/dashboard/templates/_general.lang.php"); $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); return $_LANG['dashboard']['templates']['\\'.get_called_class()]['name']; } public function getDescription() { return ''; } abstract public function configureDashboard(); }