Вход Регистрация
Файл: sngine-v2.8/Script/includes/libs/PayPal/paypal/rest-api-sdk-php/lib/PayPal/Api/WebhookList.php
Строк: 22
<?php

namespace PayPalApi;

use 
PayPalCommonPayPalModel;

/**
 * Class WebhookList
 *
 * List of webhooks.
 *
 * @package PayPalApi
 *
 * @property PayPalApiWebhook[] webhooks
 */
class WebhookList extends PayPalModel
{
    
/**
     * A list of webhooks.
     *
     * @param PayPalApiWebhook[] $webhooks
     * 
     * @return $this
     */
    
public function setWebhooks($webhooks)
    {
        
$this->webhooks $webhooks;
        return 
$this;
    }

    
/**
     * A list of webhooks.
     *
     * @return PayPalApiWebhook[]
     */
    
public function getWebhooks()
    {
        return 
$this->webhooks;
    }

    
/**
     * Append Webhooks to the list.
     *
     * @param PayPalApiWebhook $webhook
     * @return $this
     */
    
public function addWebhook($webhook)
    {
        if (!
$this->getWebhooks()) {
            return 
$this->setWebhooks(array($webhook));
        } else {
            return 
$this->setWebhooks(
                
array_merge($this->getWebhooks(), array($webhook))
            );
        }
    }

    
/**
     * Remove Webhooks from the list.
     *
     * @param PayPalApiWebhook $webhook
     * @return $this
     */
    
public function removeWebhook($webhook)
    {
        return 
$this->setWebhooks(
            
array_diff($this->getWebhooks(), array($webhook))
        );
    }

}
Онлайн: 1
Реклама