<?php

namespace App\Entities;

use App\Entities\CommonEntity;
use App\Models\UserModel;

class UserEntity extends CommonEntity
{
    public function __toString(): string
    {
        return "{$this->getPK()}:{$this->getID()}:{$this->getTitle()},{$this->getRole()}}";
    }
    public function getPK(): int
    {
        return $this->attributes[UserModel::PK];
    }
    public function getTitle(): string
    {
        return $this->attributes[UserModel::TITLE];
    }
    public function setTitle(string $title): void
    {
        $this->attributes[UserModel::TITLE] = $title;
    }
    //Common Function

    public function getID(): string
    {
        return $this->attributes['id'];
    }
    public function getRole(): string
    {
        return $this->attributes['role'];
    }
}
