You are here

function brightcove_cache_set in Brightcove Video Connect 7.6

Same name and namespace in other branches
  1. 7.7 brightcove.module \brightcove_cache_set()
  2. 7.3 brightcove.module \brightcove_cache_set()
  3. 7.4 brightcove.module \brightcove_cache_set()
  4. 7.5 brightcove.module \brightcove_cache_set()

Cache Brightcove data according to the type of caching being set.

Parameters

$cid: The id of the cache.

$data: The data going to be cached .

Return value

mixed The cached data, if exists, NULL otherwise.

7 calls to brightcove_cache_set()
brightcove_get_playlists in ./brightcove.playlist.inc
Get the playlists from Brightcove.
brightcove_load_playlist in ./brightcove.playlist.inc
Loads a Playlist object.
brightcove_load_video in ./brightcove.module
Loads Brightcove video from CMS API.
brightcove_player_load_all in ./brightcove.module
Load all players.
theme_brightcove_field_image in ./brightcove_field.formatters.inc
Theme function to render brightcove images.

... See full list

File

./brightcove.module, line 3162
Brightcove module is an integration layer between any modules using Brightcove API. It makes all necessary checks for the API and makes settings available to the user.

Code

function brightcove_cache_set($cid, $data) {

  // If cache is enabled.
  if (variable_get('brightcove_cache_enabled', TRUE)) {
    $cache_settings = variable_get('brightcove_cache_db', []);
    $cache_time = isset($cache_settings['cache_time']) ? $cache_settings['cache_time'] : 600;

    // Save data to cache table.
    cache_set($cid, $data, 'cache_brightcove', time() + $cache_time);
  }
}