<?php

namespace App\Entities;

use App\Entities\CommonEntity;

class UserEntity extends CommonEntity
{
    public function __toString(): string
    {
        return "{$this->getPK()}:{$this->getID()}:{$this->getTitle()},{$this->getLevel()}/{$this->getPoint()}";
    }
    public function getTitle(): string
    {
        return $this->attributes['_name'];
    }
    public function setTitle(string $title): void
    {
        $this->attributes['name'] = $title;
    }
    //Common Function

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