<?php

namespace App\Entities\Mangboard;

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['user_name'];
    }
    public function setTitle(string $title): void
    {
        $this->attributes['user_name'] = $title;
    }
    //Common Function

    public function getPK(): int
    {
        return $this->attributes['pid'];
    }
    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;
    }
}
