mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
42 lines
1.2 KiB
PHP
Executable File
42 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Database\Seeds;
|
|
|
|
use App\Models\Configuracion\ConfigVariableModel;
|
|
use CodeIgniter\Database\Seeder;
|
|
|
|
class DefaultConfigVariablesSeeder extends Seeder
|
|
{
|
|
protected array $data = [
|
|
[
|
|
"name" => "tamanio_solapas_min",
|
|
"value" => 50,
|
|
"description" => "Mínimo tamaño solapas"
|
|
],
|
|
[
|
|
"name" => "tamanio_solapas_max",
|
|
"value" => 150,
|
|
"description" => "Máximo tamaño solapas"
|
|
],
|
|
[
|
|
"name" => "limite_produccion_diaria",
|
|
"value" => 6000,
|
|
"description" => "Número de libros máximos que se puede producir al día"
|
|
],
|
|
[
|
|
"name" => "maquina_guillotina_id_default",
|
|
"value" => 20,
|
|
"description" => "ID de máquina que se asigna a tareas de corte tras impresión"
|
|
]
|
|
];
|
|
public function run()
|
|
{
|
|
|
|
$variableModel = model(ConfigVariableModel::class);
|
|
foreach ($this->data as $row) {
|
|
if($variableModel->where("name",$row["name"])->first() == null){
|
|
$variableModel->insert($row);
|
|
}
|
|
}
|
|
}
|
|
} |