summaryrefslogtreecommitdiff
path: root/src/user.php
blob: c09c5d53d28de0747a9d6fd81ccb4fa1b5b63c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
class User
{
    private int $id;
    private string $username;
    private int $joined_at;
    private int $last_active_at;

    function __construct($row)
    {
        $this->id = $row["id"];
        $this->username = $row["username"];
        $this->joined_at = strtotime($row["joined_at"]);
        $this->last_active_at = strtotime($row["last_active_at"]);
    }

    function id()
    {
        return $this->id;
    }

    function username()
    {
        return $this->username;
    }

    function joined_at()
    {
        return $this->joined_at;
    }

    function last_active_at()
    {
        return $this->last_active_at;
    }
}