You are here

public static function BrightcoveUtil::getPmApi in Brightcove Video Connect 8

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

Gets Brightcove PM API.

Parameters

string $entity_id: BrightcoveAPIClient entity ID.

Return value

\Brightcove\API\PM Initialized Brightcove PM API.

1 call to BrightcoveUtil::getPmApi()
BrightcoveClientQueueWorker::processItem in src/Plugin/QueueWorker/BrightcoveClientQueueWorker.php
Works on a single queue item.

File

src/BrightcoveUtil.php, line 148

Class

BrightcoveUtil
Utility class for Brightcove.

Namespace

Drupal\brightcove

Code

public static function getPmApi($entity_id) {

  // Create new \Brightcove\API\PM object if it is not exists yet.
  if (!isset(self::$pmApis[$entity_id])) {
    $client = self::getClient($entity_id);
    self::$pmApis[$entity_id] = new PM($client, self::$apiClients[$entity_id]
      ->getAccountId());
  }
  return self::$pmApis[$entity_id];
}