2022-04-18 10:33:18 -07:00
|
|
|
<?php
|
2025-03-29 10:50:03 +00:00
|
|
|
|
2022-04-21 10:34:11 -07:00
|
|
|
/**
|
|
|
|
|
* Represents a custom profile field which belongs to a user.
|
|
|
|
|
*
|
|
|
|
|
* @package NamelessMC\DTO
|
|
|
|
|
* @author Aberdeener
|
2025-01-08 20:19:02 +00:00
|
|
|
* @version 2.2.0
|
2022-04-21 10:34:11 -07:00
|
|
|
* @license MIT
|
|
|
|
|
*/
|
2024-03-09 03:19:55 -08:00
|
|
|
class UserProfileField extends ProfileField
|
|
|
|
|
{
|
2022-04-18 10:33:18 -07:00
|
|
|
public ?string $value;
|
2022-05-09 21:43:59 -06:00
|
|
|
public ?int $updated;
|
2022-04-18 10:33:18 -07:00
|
|
|
public ?int $upf_id;
|
|
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public function __construct(object $row)
|
|
|
|
|
{
|
2022-04-18 10:33:18 -07:00
|
|
|
parent::__construct($row);
|
|
|
|
|
$this->value = $row->value;
|
2022-05-09 21:43:59 -06:00
|
|
|
$this->updated = $row->updated;
|
2022-04-18 10:33:18 -07:00
|
|
|
$this->upf_id = $row->upf_id;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-08 20:19:02 +00:00
|
|
|
public function purifyValue(): ?string
|
|
|
|
|
{
|
|
|
|
|
// TODO: option for field to support HTML
|
|
|
|
|
return Output::getClean($this->value);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-09 03:19:55 -08:00
|
|
|
public function updated()
|
|
|
|
|
{
|
2022-05-09 21:43:59 -06:00
|
|
|
return date(DATE_FORMAT, $this->updated);
|
|
|
|
|
}
|
2022-04-18 10:33:18 -07:00
|
|
|
}
|