mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-01-16 18:04:34 -05:00
47 lines
1.0 KiB
PHP
47 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Gazelle;
|
|
|
|
class Invite extends Base {
|
|
protected array $info;
|
|
|
|
public function __construct(
|
|
protected string $key,
|
|
) {}
|
|
|
|
public function info(): array {
|
|
if (!isset($this->info)) {
|
|
$this->info = self::$db->rowAssoc("
|
|
SELECT InviterID AS user_id,
|
|
Email AS email,
|
|
Expires AS created,
|
|
Reason AS reason
|
|
FROM invites
|
|
WHERE InviteKey = ?
|
|
", $this->key
|
|
) ?? [];
|
|
}
|
|
return $this->info;
|
|
}
|
|
|
|
public function created(): string {
|
|
return $this->info()['created'];
|
|
}
|
|
|
|
public function email(): string {
|
|
return $this->info()['email'];
|
|
}
|
|
|
|
public function key(): string {
|
|
return $this->key;
|
|
}
|
|
|
|
public function reason(): string {
|
|
return $this->info()['reason'];
|
|
}
|
|
|
|
public function userId(): int {
|
|
return $this->info()['user_id'];
|
|
}
|
|
}
|