| 1 | <?php  | 
            ||
| 22 | class LoadUserEvent extends Event  | 
            ||
| 23 | { | 
            ||
| 24 | /**  | 
            ||
| 25 | * The event name that happens before a user is loaded from the user provider.  | 
            ||
| 26 | */  | 
            ||
| 27 | const BEFORE = 'ldap_tools_bundle.load_user.before';  | 
            ||
| 28 | |||
| 29 | /**  | 
            ||
| 30 | * The event name that happens after a user is loaded from the user provider.  | 
            ||
| 31 | */  | 
            ||
| 32 | const AFTER = 'ldap_tools_bundle.load_user.after';  | 
            ||
| 33 | |||
| 34 | /**  | 
            ||
| 35 | * @var string  | 
            ||
| 36 | */  | 
            ||
| 37 | protected $username;  | 
            ||
| 38 | |||
| 39 | /**  | 
            ||
| 40 | * @var string  | 
            ||
| 41 | */  | 
            ||
| 42 | protected $domain;  | 
            ||
| 43 | |||
| 44 | /**  | 
            ||
| 45 | * @var UserInterface|LdapUser|null  | 
            ||
| 46 | */  | 
            ||
| 47 | protected $user;  | 
            ||
| 48 | |||
| 49 | /**  | 
            ||
| 50 | * @param $username  | 
            ||
| 51 | * @param $domain  | 
            ||
| 52 | * @param UserInterface $user  | 
            ||
| 53 | */  | 
            ||
| 54 | public function __construct($username, $domain, UserInterface $user = null)  | 
            ||
| 60 | |||
| 61 | /**  | 
            ||
| 62 | * @return string  | 
            ||
| 63 | */  | 
            ||
| 64 | public function getUsername()  | 
            ||
| 68 | |||
| 69 | /**  | 
            ||
| 70 | * @return string  | 
            ||
| 71 | */  | 
            ||
| 72 | public function getDomain()  | 
            ||
| 76 | |||
| 77 | /**  | 
            ||
| 78 | * This is only available on an AFTER load event. Otherwise it will be null.  | 
            ||
| 79 | *  | 
            ||
| 80 | * @return LdapUser|null|UserInterface  | 
            ||
| 81 | */  | 
            ||
| 82 | public function getUser()  | 
            ||
| 86 | }  | 
            ||
| 87 |