1 <?php
2
3 namespace PayPal\Api;
4
5 use PayPal\Common\PayPalModel;
6
7 8 9 10 11 12 13 14 15
16 class WebhookList extends PayPalModel
17 {
18 19 20 21 22 23 24
25 public function setWebhooks($webhooks)
26 {
27 $this->webhooks = $webhooks;
28 return $this;
29 }
30
31 32 33 34 35
36 public function getWebhooks()
37 {
38 return $this->webhooks;
39 }
40
41 42 43 44 45 46
47 public function addWebhook($webhook)
48 {
49 if (!$this->getWebhooks()) {
50 return $this->setWebhooks(array($webhook));
51 } else {
52 return $this->setWebhooks(
53 array_merge($this->getWebhooks(), array($webhook))
54 );
55 }
56 }
57
58 59 60 61 62 63
64 public function removeWebhook($webhook)
65 {
66 return $this->setWebhooks(
67 array_diff($this->getWebhooks(), array($webhook))
68 );
69 }
70
71 }
72