<?php

namespace App\Models;

use CodeIgniter\Model;

class GeneroModel extends Model
{
    protected $table            = 'genero';
    protected $primaryKey       = 'id_genero';
    protected $useAutoIncrement = true;
    protected $returnType       = 'App\Entities\Genero';
    protected $useSoftDeletes   = false;
    protected $protectFields    = true;
    protected $allowedFields    = ['nombre'];

    // Validation
    protected $validationRules      = [
        'nombre' => 'required|min_length[2]|max_length[80]|is_unique[genero.nombre,id_genero,{id_genero}]',
    ];
    protected $skipValidation       = false;
}
