Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace LdapRecord\Auth\Events; |
| 4 | |
| 5 | use LdapRecord\LdapInterface; |
| 6 | |
| 7 | abstract class Event |
| 8 | { |
| 9 | /** |
| 10 | * The connection that the username and password is being bound on. |
| 11 | * |
| 12 | * @var LdapInterface |
| 13 | */ |
| 14 | protected $connection; |
| 15 | |
| 16 | /** |
| 17 | * The username that is being used for binding. |
| 18 | * |
| 19 | * @var string |
| 20 | */ |
| 21 | protected $username; |
| 22 | |
| 23 | /** |
| 24 | * The password that is being used for binding. |
| 25 | * |
| 26 | * @var string |
| 27 | */ |
| 28 | protected $password; |
| 29 | |
| 30 | /** |
| 31 | * Constructor. |
| 32 | * |
| 33 | * @param LdapInterface $connection |
| 34 | * @param string $username |
| 35 | * @param string $password |
| 36 | */ |
| 37 | public function __construct(LdapInterface $connection, $username, $password) |
| 38 | { |
| 39 | $this->connection = $connection; |
| 40 | $this->username = $username; |
| 41 | $this->password = $password; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the events connection. |
| 46 | * |
| 47 | * @return LdapInterface |
| 48 | */ |
| 49 | public function getConnection() |
| 50 | { |
| 51 | return $this->connection; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Returns the authentication events username. |
| 56 | * |
| 57 | * @return string |
| 58 | */ |
| 59 | public function getUsername() |
| 60 | { |
| 61 | return $this->username; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * Returns the authentication events password. |
| 66 | * |
| 67 | * @return string |
| 68 | */ |
| 69 | public function getPassword() |
| 70 | { |
| 71 | return $this->password; |
| 72 | } |
| 73 | } |