cfmgrv4/app/Entities/UserEntity.php
2024-10-01 18:25:10 +09:00

37 lines
793 B
PHP

<?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'];
}
}