Automation/app/Entities/UserEntity.php
2024-09-22 01:04:33 +09:00

50 lines
1.1 KiB
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->getLevel()}/{$this->getPoint()}";
}
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 getPoint(): int
{
return $this->attributes['point'];
}
public function setPoint(int $point): void
{
$this->attributes['point'] = $point;
}
public function getLevel(): int
{
return $this->attributes['level'];
}
public function setLevel(int $value): void
{
$this->attributes['level'] = $value;
}
}