PayPalApiWebhookList

Class WebhookList.

Defined (1)

The class is defined in the following location(s).

/classes/lib/PayPal/Api/WebhookList.php  
  1. class WebhookList extends PayPalModel 
  2. /** 
  3. * A list of Webhooks 
  4. * @param \PayPal\Api\Webhook[] $webhooks 
  5. *  
  6. * @return $this 
  7. */ 
  8. public function setWebhooks($webhooks) 
  9. $this->webhooks = $webhooks; 
  10. return $this; 
  11.  
  12. /** 
  13. * A list of Webhooks 
  14. * @return \PayPal\Api\Webhook[] 
  15. */ 
  16. public function getWebhooks() 
  17. return $this->webhooks; 
  18.  
  19. /** 
  20. * Append Webhooks to the list. 
  21. * @param \PayPal\Api\Webhook $webhook 
  22. * @return $this 
  23. */ 
  24. public function addWebhook($webhook) 
  25. if (!$this->getWebhooks()) { 
  26. return $this->setWebhooks(array($webhook)); 
  27. } else { 
  28. return $this->setWebhooks( 
  29. array_merge($this->getWebhooks(), array($webhook)) 
  30. ); 
  31.  
  32. /** 
  33. * Remove Webhooks from the list. 
  34. * @param \PayPal\Api\Webhook $webhook 
  35. * @return $this 
  36. */ 
  37. public function removeWebhook($webhook) 
  38. return $this->setWebhooks( 
  39. array_diff($this->getWebhooks(), array($webhook)) 
  40. ); 
  41.