You are here

function brightcove_client_load_or_default in Brightcove Video Connect 7.7

Same name and namespace in other branches
  1. 7.6 brightcove.client.inc \brightcove_client_load_or_default()

Load a client or if none given, the default client.

Parameters

string $bcid: The client entity id.

Return value

Entity|boolean The client entity object or FALSE.

12 calls to brightcove_client_load_or_default()
ajax_brightcove_media_upload_callback in brightcove_media/brightcove_media.module
Ajax callback for upload form
brightcove_admin_player_edit_form in ./brightcove.player.inc
Form callback for 'admin/config/media/brightcove/players/{%/%/edit,add}'.
brightcove_field_browser_video_validate in ./brightcove.module
Validate callback for the video field.
brightcove_field_formatter_view in ./brightcove.module
Implements hook_field_formatter_view().
brightcove_field_video_browser_value in ./brightcove.module
Callback for Brightcove field browser widget. Will return a field value in "video-name [id:videoId]" format.

... See full list

File

./brightcove.client.inc, line 538
Client related code.

Code

function brightcove_client_load_or_default($bcid = NULL) {
  if ($bcid) {
    $client = brightcove_client_load($bcid);
    if ($client) {
      return $client;
    }
  }
  if ($default_bcid = variable_get('brightcove_client_default')) {
    $client = brightcove_client_load($default_bcid);
    if ($client) {
      return $client;
    }
  }
  return FALSE;
}