cfmgrv4/app/Entities/Mangboard/UserEntity.php
2024-09-24 17:29:05 +09:00

51 lines
1.1 KiB
PHP

<?php
namespace App\Entities\Mangboard;
use App\Models\Mangboard\UserModel;
use App\Entities\CommonEntity;
class UserEntity extends CommonEntity
{
public function __toString(): string
{
return "{$this->getPK()}|{$this->getID()}|{$this->getTitle()}|lvl:{$this->getLevel()},point:{$this->getPoint()}";
}
public function getTitle(): string
{
return $this->attributes[UserModel::TITLE];
}
public function setTitle(string $title): void
{
$this->attributes[UserModel::TITLE] = $title;
}
//Common Function
public function getPK(): int
{
return $this->attributes[UserModel::PK];
}
public function getID(): string
{
return $this->attributes['user_id'];
}
public function getPoint(): int
{
return $this->attributes['user_point'];
}
public function setPoint(int $point): void
{
$this->attributes['user_point'] = $point;
}
public function getLevel(): int
{
return $this->attributes['user_level'];
}
public function setLevel(int $value): void
{
$this->attributes['user_level'] = $value;
}
}