feat wiki/ayuda section

This commit is contained in:
amazuecos
2025-03-02 10:22:01 +01:00
parent 3406fb3005
commit 3140e527e8
24 changed files with 735 additions and 168 deletions

View File

@ -16,8 +16,8 @@ class WikiSectionModel extends Model
protected $allowedFields = [
"name",
"slug",
"role",
"icon",
"order",
"parent_id"
];
@ -58,6 +58,6 @@ class WikiSectionModel extends Model
*/
public function sections() : array
{
return $this->findAll();
return $this->orderBy('order','asc')->findAll();
}
}

View File

@ -0,0 +1,52 @@
<?php
namespace App\Models\Wiki;
use App\Entities\Wiki\WikiSectionRoleEntity;
use CodeIgniter\Model;
class WikiSectionRoleModel extends Model
{
protected $table = 'wiki_section_roles';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = WikiSectionRoleEntity::class;
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
"wiki_section_id",
"role"
];
protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true;
protected array $casts = [];
protected array $castHandlers = [];
// Dates
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
}