mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
trabajando en formularios/vista paises
This commit is contained in:
78
ci4/app/Models/Configuracion/PaisModel.php
Normal file
78
ci4/app/Models/Configuracion/PaisModel.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class PaisModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "lg_paises";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = ["nombre", "code", "code3", "moneda", "url_erp", "user_erp", "key_erp", "show_erp"];
|
||||
protected $returnType = "App\Entities\Admin\Pais";
|
||||
|
||||
public static $labelField = "Select a field...";
|
||||
|
||||
protected $validationRules = [
|
||||
"code" => [
|
||||
"label" => "Paises.code",
|
||||
"rules" => "trim|required|max_length[2]|is_unique[lg_paises.code,id,{id}]",
|
||||
],
|
||||
"code3" => [
|
||||
"label" => "Paises.code3",
|
||||
"rules" => "trim|max_length[3]",
|
||||
],
|
||||
"key_erp" => [
|
||||
"label" => "Paises.keyErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
"moneda" => [
|
||||
"label" => "Paises.moneda",
|
||||
"rules" => "trim|required|max_length[3]",
|
||||
],
|
||||
"nombre" => [
|
||||
"label" => "Paises.nombre",
|
||||
"rules" => "trim|required|max_length[255]",
|
||||
],
|
||||
"url_erp" => [
|
||||
"label" => "Paises.urlErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
"user_erp" => [
|
||||
"label" => "Paises.userErp",
|
||||
"rules" => "trim|max_length[255]",
|
||||
],
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"code" => [
|
||||
"is_unique" => "Paises.validation.code.is_unique",
|
||||
"max_length" => "Paises.validation.code.max_length",
|
||||
"required" => "Paises.validation.code.required",
|
||||
],
|
||||
"code3" => [
|
||||
"max_length" => "Paises.validation.code3.max_length",
|
||||
],
|
||||
"key_erp" => [
|
||||
"max_length" => "Paises.validation.key_erp.max_length",
|
||||
],
|
||||
"moneda" => [
|
||||
"max_length" => "Paises.validation.moneda.max_length",
|
||||
"required" => "Paises.validation.moneda.required",
|
||||
],
|
||||
"nombre" => [
|
||||
"max_length" => "Paises.validation.nombre.max_length",
|
||||
"required" => "Paises.validation.nombre.required",
|
||||
],
|
||||
"url_erp" => [
|
||||
"max_length" => "Paises.validation.url_erp.max_length",
|
||||
],
|
||||
"user_erp" => [
|
||||
"max_length" => "Paises.validation.user_erp.max_length",
|
||||
],
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user