PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.1.0
GiveWP – Donation Plugin and Fundraising Platform v4.1.0
4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 All 253 releases
give / src / Framework / FieldsAPI / Exceptions / NameCollisionException.php
NameCollisionException.php
67 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Give\Framework\FieldsAPI\Exceptions;
4
5 use Give\Framework\Exceptions\Primitives\Exception;
6 use Give\Framework\FieldsAPI\Contracts\Node;
7
8 /**
9 * @since 2.32.0 add existing and incoming nodes to exception
10 * @since 2.10.2
11 */
12 class NameCollisionException extends Exception
13 {
14 /**
15 * @var string
16 */
17 protected $nodeNameCollision;
18 /**
19 * @var Node
20 */
21 protected $existingNode;
22 /**
23 * @var Node
24 */
25 protected $incomingNode;
26
27 public function __construct(
28 string $name,
29 Node $existingNode,
30 Node $incomingNode,
31 int $code = 0,
32 Exception $previous = null
33 )
34 {
35 $this->nodeNameCollision = $name;
36 $this->existingNode = $existingNode;
37 $this->incomingNode = $incomingNode;
38
39 $message = "Node name collision for $name";
40 parent::__construct($message, $code, $previous);
41 }
42
43 /**
44 * @since 2.32.0
45 */
46 public function getNodeNameCollision(): string
47 {
48 return $this->nodeNameCollision;
49 }
50
51 /**
52 * @since 2.32.0
53 */
54 public function getIncomingNode(): Node
55 {
56 return $this->incomingNode;
57 }
58
59 /**
60 * @since 2.32.0
61 */
62 public function getExistingNode(): Node
63 {
64 return $this->existingNode;
65 }
66 }
67