Files
safekat/ci4/app/Models/Configuracion/ConfiguracionSistemaModel.php
2024-05-02 23:52:46 +02:00

38 lines
896 B
PHP
Executable File

<?php
namespace App\Models\Configuracion;
class ConfiguracionSistemaModel extends \App\Models\BaseModel
{
protected $table = "configuracion_sistema";
/**
* Whether primary key uses auto increment.
*
* @var bool
*/
protected $useAutoIncrement = true;
protected $allowedFields = ["var_name", "value", "datatype"];
protected $returnType = "App\Entities\Configuracion\ConfiguracionSistemaEntity";
public static $labelField = "var_name";
protected $validationRules = [
];
protected $validationMessages = [
];
public function getPOD()
{
$builder = $this->db
->table($this->table . " t1")
->select(
'(SELECT CAST(t1.value AS INT)) AS POD', false)
->where('t1.var_name', 'POD');
$POD = intval($builder->get()->getFirstRow()->POD);
return $POD;
}
}