You are here

public static function BrightcoveAPIClient::loadByAccountId in Brightcove Video Connect 8.2

Same name and namespace in other branches
  1. 8 src/Entity/BrightcoveAPIClient.php \Drupal\brightcove\Entity\BrightcoveAPIClient::loadByAccountId()
  2. 3.x src/Entity/BrightcoveAPIClient.php \Drupal\brightcove\Entity\BrightcoveAPIClient::loadByAccountId()

Loads API client by the Brightcove account ID.

Parameters

string $account_id: Brightcove account ID.

Return value

\Drupal\brightcove\Entity\BrightcoveAPIClient|null Loaded BrightcoveAPIClient entity or NULL if cannot be found.

1 call to BrightcoveAPIClient::loadByAccountId()
BrightcoveSubscriptionController::notificationCallback in src/Controller/BrightcoveSubscriptionController.php
Menu callback to handle the Brightcove notification callback.

File

src/Entity/BrightcoveAPIClient.php, line 353

Class

BrightcoveAPIClient
Defines the Brightcove API Client entity.

Namespace

Drupal\brightcove\Entity

Code

public static function loadByAccountId($account_id) {
  $api_client_ids = \Drupal::entityQuery('brightcove_api_client')
    ->condition('account_id', $account_id)
    ->execute();
  if (!empty($api_client_ids)) {
    return self::load(reset($api_client_ids));
  }
  return NULL;
}