<?php

namespace App\Entities;

use App\Entities\CommonEntity;
use App\Models\UserModel as Model;

class UserEntity extends CommonEntity
{
    const PK = Model::PK;
    const TITLE = Model::TITLE;

    public function __construct(array|null $data = null)
    {
        parent::__construct($data);
        $this->nullableFields = [
            ...$this->nullableFields,
            'mobile',
        ];
    }

    public function getID(): string
    {
        return $this->id;
    }

    public function getPassword(): string
    {
        return $this->passwd;
    }
    public function getRole(): string
    {
        return $this->role;
    }
    public function getRoles(): array
    {
        return explode(DEFAULTS['DELIMITER_COMMA'], $this->getRole());
    }
    public function getEmail(): string
    {
        return $this->email;
    }
    public function getMobile(): ?string
    {
        return $this->mobile;
    }
}