1<?php
2/**
3 * This file is part of the FreeDSx LDAP package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Ldap\Exception;
12
13/**
14 * Thrown when an unsolicited notification is received. Holds the error, code, and OID of the notification type.
15 *
16 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
17 */
18class UnsolicitedNotificationException extends ProtocolException
19{
20    /**
21     * @var string
22     */
23    protected $oid;
24
25    /**
26     * @param string $message
27     * @param int $code
28     * @param \Throwable|null $previous
29     * @param string $oid
30     */
31    public function __construct($message = "", $code = 0, \Throwable $previous = null, $oid = "")
32    {
33        $this->oid = $oid;
34        parent::__construct($message, $code, $previous);
35    }
36
37    /**
38     * Get the name OID identifying the unsolicited notification.
39     *
40     * @return string
41     */
42    public function getOid()
43    {
44        return $this->oid;
45    }
46}
47