Automation/app/Entities/Mangboard/UserEntity.php
2024-08-27 17:03:04 +09:00

49 lines
1000 B
PHP

<?php
namespace App\Entities\Mangboard;
use CodeIgniter\Entity\Entity;
class UserEntity extends Entity
{
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
public function __toString()
{
return "{$this->getPK()}:{$this->getID()}:{$this->getName()}";
}
public function getPK()
{
return $this->attributes['pid'];
}
public function getID()
{
return $this->attributes['user_id'];
}
public function getName()
{
return $this->attributes['user_name'];
}
public function getPoint()
{
return $this->attributes['user_point'];
}
public function setPoint(int $point)
{
$this->attributes['user_point'] = $point;
}
public function getLevel()
{
return $this->attributes['user_level'];
}
public function setLevel(int $level)
{
$this->attributes['user_level'] = $level;
}
}