<?php
namespace App\Entities\Wiki;

use App\Models\Wiki\WikiSectionModel;
use CodeIgniter\Entity\Entity;

class WikiSectionRoleEntity extends Entity
{
    protected $attributes = [
        "wiki_section_id" => null,
        "role" => null,
    ];
    protected $casts = [
        "wiki_section_id" => "int",
        "role" => "string",
    ];

    public function page(): ?WikiSectionEntity 
    {
        $m = model(WikiSectionModel::class);
        return $m->where('id',$this->attributes['section_id'])->first();
    }


 
}
