mc-cms-namelessmc/core/classes/DTO/UserProfileField.php

36 lines
742 B
PHP
Raw Permalink Normal View History

2022-04-18 10:33:18 -07:00
<?php
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
*/
class UserProfileField extends ProfileField
{
2022-04-18 10:33:18 -07:00
public ?string $value;
public ?int $updated;
2022-04-18 10:33:18 -07:00
public ?int $upf_id;
public function __construct(object $row)
{
2022-04-18 10:33:18 -07:00
parent::__construct($row);
$this->value = $row->value;
$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);
}
public function updated()
{
return date(DATE_FORMAT, $this->updated);
}
2022-04-18 10:33:18 -07:00
}