You are here

function kaltura_get_entries in Kaltura 7.2

Same name and namespace in other branches
  1. 5 kaltura.module \kaltura_get_entries()
  2. 6.2 kaltura.module \kaltura_get_entries()
  3. 6 kaltura.module \kaltura_get_entries()

Helper function to call the getEntries service CMAC.

Need to amalgamate mix and media entries.

Parameters

array $entries:

bool $is_admin:

Return value

array returns array made up of Mix and media entries

TODO: move to kaltura helpers.

2 calls to kaltura_get_entries()
kaltura_cron in ./kaltura.module
Implements hook_cron().
kaltura_import_entries in includes/kaltura.admin.inc
Helper function that uses kaltura_get_entries() to retrieve a list of specific entries belongs to the partner, and call kaltura_import_entry() for each of the retrieved list

File

./kaltura.module, line 668
Kaltura integration module - core functions.

Code

function kaltura_get_entries($entries, $is_admin = FALSE) {
  $chunks = array_chunk($entries, '100');
  try {
    foreach ($chunks as $chunk) {
      $entries_list = implode(',', $chunk);
      $k_helpers = new KalturaHelpers();
      $kaltura_client = $k_helpers
        ->getKalturaClient($is_admin);
      $session_user = $k_helpers
        ->getSessionUser();
      libraries_load('KalturaClient');
      $kmf = new KalturaBaseEntryFilter();
      $kmp = new KalturaFilterPager('100');
      $kmf->idIn = $entries_list;
      $results[] = $kaltura_client->baseEntry
        ->listAction($kmf, $kmp);
    }
    $result = array_values($results);
    if ($result) {
      return $result;
    }
  } catch (Exception $e) {
    watchdog_exception('kaltura', $e);
  }
  return FALSE;
}