IRepository::findByUsername()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
1
<?php
2
/**
3
 * IRepository.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        http://www.ipublikuj.eu
7
 * @author         Adam Kadlec http://www.ipublikuj.eu
8
 * @package        iPublikuj:WebSocketSession!
9
 * @subpackage     Users
10
 * @since          1.0.0
11
 *
12
 * @date           24.02.17
13
 */
14
15
declare(strict_types = 1);
16
17
namespace IPub\WebSocketsSession\Users;
18
19
use Nette\Security as NS;
20
21
use IPub;
22
use IPub\WebSockets\Entities as WebSocketsEntities;
23
24
/**
25
 * Connected users repository interface
26
 *
27
 * @package        iPublikuj:WebSocketSession!
28
 * @subpackage     Users
29
 *
30
 * @author         Adam Kadlec <[email protected]>
31
 */
32 1
interface IRepository
33
{
34
	/**
35
	 * @param WebSocketsEntities\Clients\IClient $client
36
	 *
37
	 * @return NS\User|NULL
38
	 */
39
	function getUser(WebSocketsEntities\Clients\IClient $client);
40
41
	/**
42
	 * @param string $username
43
	 *
44
	 * @return array|bool
45
	 */
46
	function findByUsername(string $username);
47
48
	/**
49
	 * @param mixed $userId
50
	 *
51
	 * @return array|bool
52
	 */
53
	function findById($userId);
54
55
	/**
56
	 * @param bool $anonymous
57
	 *
58
	 * @return array|bool
59
	 */
60
	function findAll(bool $anonymous = FALSE);
61
62
	/**
63
	 * @param array $roles
64
	 *
65
	 * @return array|bool
66
	 */
67
	function findByRoles(array $roles);
68
}
69