Постфиксная запись типов вместо префиксной
This commit is contained in:
parent
04662a94df
commit
11370eecc9
33 changed files with 95 additions and 79 deletions
|
|
@ -5,7 +5,7 @@ use ctiso\Database,
|
|||
ctiso\Database\Statement;
|
||||
|
||||
// Класс должен быть в библиотеке приложения
|
||||
class User
|
||||
class User implements UserInterface
|
||||
{
|
||||
const LIFE_TIME = 1800; // = 30min * 60sec;
|
||||
|
||||
|
|
@ -26,6 +26,10 @@ class User
|
|||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function getUserByQuery(Statement $stmt)
|
||||
{
|
||||
$result = $stmt->executeQuery();
|
||||
|
|
|
|||
11
src/Role/UserInterface.php
Normal file
11
src/Role/UserInterface.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
namespace ctiso\Role;
|
||||
|
||||
interface UserInterface {
|
||||
function getUserByQuery(Statement $stmt);
|
||||
function getUserByLogin($login);
|
||||
function getUserById($id);
|
||||
function getName();
|
||||
function setSID();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue