@@ 121-128 (lines=8) @@ | ||
118 | * |
|
119 | * @return array|bool |
|
120 | */ |
|
121 | public function getByToken($token) |
|
122 | { |
|
123 | if (empty($token)) { |
|
124 | return false; |
|
125 | } |
|
126 | ||
127 | return $this->db->table(self::TABLE)->eq('token', $token)->eq('is_public', 1)->findOne(); |
|
128 | } |
|
129 | ||
130 | /** |
|
131 | * Return the first project from the database (no sorting). |
@@ 44-52 (lines=9) @@ | ||
41 | * |
|
42 | * @return mixed |
|
43 | */ |
|
44 | public function find($token, $sequence) |
|
45 | { |
|
46 | return $this->db |
|
47 | ->table(self::TABLE) |
|
48 | ->eq('token', $token) |
|
49 | ->eq('sequence', $sequence) |
|
50 | ->gt('expiration', time()) |
|
51 | ->findOne(); |
|
52 | } |
|
53 | ||
54 | /** |
|
55 | * Get all sessions for a given user. |