PayPalApiWebhookEventTypeList

Class WebhookEventTypeList.

Defined (1)

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

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