You are here

public static function BrightcoveSubscription::listFromBrightcove in Brightcove Video Connect 8

Same name and namespace in other branches
  1. 8.2 src/Entity/BrightcoveSubscription.php \Drupal\brightcove\Entity\BrightcoveSubscription::listFromBrightcove()
  2. 3.x src/Entity/BrightcoveSubscription.php \Drupal\brightcove\Entity\BrightcoveSubscription::listFromBrightcove()

Get all available subscriptions from Brightcove.

Parameters

\Drupal\brightcove\BrightcoveAPIClientInterface $api_client: API Client entity.

Return value

\Brightcove\Object\Subscription[] List of subscriptions or null of there are none.

2 calls to BrightcoveSubscription::listFromBrightcove()
BrightcoveSubscriptionController::createDefaults in src/Controller/BrightcoveSubscriptionController.php
Creates default subscriptions.
BrightcoveSubscriptionController::listSubscriptions in src/Controller/BrightcoveSubscriptionController.php
Lists available Brightcove Subscriptions.

File

src/Entity/BrightcoveSubscription.php, line 671

Class

BrightcoveSubscription
Defines the Brightcove Subscription entity.

Namespace

Drupal\brightcove\Entity

Code

public static function listFromBrightcove(BrightcoveAPIClientInterface $api_client) {
  $subscriptions =& drupal_static(__FUNCTION__);
  if (is_null($subscriptions)) {
    $cms = BrightcoveUtil::getCmsApi($api_client
      ->id());
    $subscriptions = $cms
      ->getSubscriptions();
  }
  return $subscriptions;
}