Automation/app/Entities/UserEntity.php
2024-09-03 19:42:09 +09:00

44 lines
958 B
PHP

<?php
namespace App\Entities;
use CodeIgniter\Entity\Entity;
class UserEntity extends CommonEntity
{
public function __toString(): string
{
return "{$this->getPK()}:{$this->getID()}:{$this->getName()},{$this->getLevel()}/{$this->getPoint()}";
}
public function getPK(): int
{
return $this->attributes['pid'];
}
public function getName(): string
{
return $this->attributes['user_name'];
}
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 $level): void
{
$this->attributes['user_level'] = $level;
}
}