<?php
/**
 * @author      Alex Bilbie <hello@alexbilbie.com>
 * @copyright   Copyright (c) Alex Bilbie
 * @license     http://mit-license.org/
 *
 * @link        https://github.com/thephpleague/oauth2-server
 */

namespace Docuform\Api\Authentication\Entities;

use League\OAuth2\Server\Entities\UserEntityInterface;
use Docuform\Api\ApiUser;
use Docuform\Lib\ApiUuid;

#[\AllowDynamicProperties]
class UserEntity extends ApiUser implements UserEntityInterface
{
  /**
   * Return the user's identifier.
   *
   * @return string
   */
  public function getIdentifier(): string
  {
    $uuid = $this->__get('uuid');

    $uuid = ApiUuid::toHex($uuid);

    return $uuid;
  }
}