This commit is contained in:
2025-10-04 11:46:59 +07:00
commit 97427d7cff
498 changed files with 47596 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace Hura8\System\Model;
use Hura8\Database\iConnectDB;
use Hura8\Interfaces\AppResponse;
/**
* @date 21-Dec-2023
* @description various utility for management and setup
*/
class UtilityModel
{
protected $db;
protected $tb_entity_lang_template = "tb_entity_lang_template";
public function __construct($db_id = '') {
$this->db = get_db($db_id, ENABLE_DB_DEBUG);
}
public function createTableLang($tb_entity_lang): AppResponse {
$result = $this->db->checkTableExist($tb_entity_lang);
// check if table exist
if(!$result) {
$this->db->runQuery("CREATE TABLE `".$tb_entity_lang."` LIKE `".$this->tb_entity_lang_template."` ");
// recheck
$result = $this->db->checkTableExist($tb_entity_lang);
}
return new AppResponse($result ? 'ok': 'error');
}
}