1 | <?php |
||
23 | class LoadUserEvent extends Event |
||
24 | { |
||
25 | /** |
||
26 | * The event name that happens before a user is loaded from the user provider. |
||
27 | */ |
||
28 | const BEFORE = 'ldap_tools_bundle.load_user.before'; |
||
29 | |||
30 | /** |
||
31 | * The event name that happens after a user is loaded from the user provider. |
||
32 | */ |
||
33 | const AFTER = 'ldap_tools_bundle.load_user.after'; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $username; |
||
39 | |||
40 | /** |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $domain; |
||
44 | |||
45 | /** |
||
46 | * @var UserInterface|LdapUser|null |
||
47 | */ |
||
48 | protected $user; |
||
49 | |||
50 | /** |
||
51 | * @var LdapObject|null |
||
52 | */ |
||
53 | protected $ldapObject; |
||
54 | |||
55 | /** |
||
56 | * @param $username |
||
57 | * @param $domain |
||
58 | * @param UserInterface|null $user |
||
59 | * @param LdapObject|null $ldapObject |
||
60 | */ |
||
61 | public function __construct($username, $domain, UserInterface $user = null, LdapObject $ldapObject = null) |
||
68 | |||
69 | /** |
||
70 | * @return string |
||
71 | */ |
||
72 | public function getUsername() |
||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getDomain() |
||
84 | |||
85 | /** |
||
86 | * This is only available on an AFTER load event. Otherwise it will be null. |
||
87 | * |
||
88 | * @return LdapUser|null|UserInterface |
||
89 | */ |
||
90 | public function getUser() |
||
94 | |||
95 | /** |
||
96 | * Get the LDAP object the user was created from. This is only available on an AFTER load event. |
||
97 | * |
||
98 | * @return LdapObject|null |
||
99 | */ |
||
100 | public function getLdapObject() |
||
104 | } |
||
105 |