You are here

public static function BrightcoveUtil::getDiApi in Brightcove Video Connect 3.x

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

Gets Brightcove DI API.

Parameters

string $entity_id: BrightcoveAPIClient entity ID.

Return value

\Brightcove\API\DI Initialized Brightcove CMS API.

1 call to BrightcoveUtil::getDiApi()
BrightcoveVideo::save in src/Entity/BrightcoveVideo.php

File

src/BrightcoveUtil.php, line 130

Class

BrightcoveUtil
Utility class for Brightcove.

Namespace

Drupal\brightcove

Code

public static function getDiApi($entity_id) {

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