Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame^] | 1 | <?php |
| 2 | |
| 3 | namespace Adldap\Connections; |
| 4 | |
| 5 | class DetailedError |
| 6 | { |
| 7 | /** |
| 8 | * The error code from ldap_errno. |
| 9 | * |
| 10 | * @var int|null |
| 11 | */ |
| 12 | protected $errorCode; |
| 13 | |
| 14 | /** |
| 15 | * The error message from ldap_error. |
| 16 | * |
| 17 | * @var string|null |
| 18 | */ |
| 19 | protected $errorMessage; |
| 20 | |
| 21 | /** |
| 22 | * The diagnostic message when retrieved after an ldap_error. |
| 23 | * |
| 24 | * @var string|null |
| 25 | */ |
| 26 | protected $diagnosticMessage; |
| 27 | |
| 28 | /** |
| 29 | * Constructor. |
| 30 | * |
| 31 | * @param int $errorCode |
| 32 | * @param string $errorMessage |
| 33 | * @param string $diagnosticMessage |
| 34 | */ |
| 35 | public function __construct($errorCode, $errorMessage, $diagnosticMessage) |
| 36 | { |
| 37 | $this->errorCode = $errorCode; |
| 38 | $this->errorMessage = $errorMessage; |
| 39 | $this->diagnosticMessage = $diagnosticMessage; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Returns the LDAP error code. |
| 44 | * |
| 45 | * @return int |
| 46 | */ |
| 47 | public function getErrorCode() |
| 48 | { |
| 49 | return $this->errorCode; |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Returns the LDAP error message. |
| 54 | * |
| 55 | * @return string |
| 56 | */ |
| 57 | public function getErrorMessage() |
| 58 | { |
| 59 | return $this->errorMessage; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Returns the LDAP diagnostic message. |
| 64 | * |
| 65 | * @return string |
| 66 | */ |
| 67 | public function getDiagnosticMessage() |
| 68 | { |
| 69 | return $this->diagnosticMessage; |
| 70 | } |
| 71 | } |