You are here

function kaltura_remove_existing_entries in Kaltura 5

Same name and namespace in other branches
  1. 6.2 includes/kaltura.admin.inc \kaltura_remove_existing_entries()
  2. 6 includes/kaltura.admin.inc \kaltura_remove_existing_entries()
  3. 7.2 includes/kaltura.admin.inc \kaltura_remove_existing_entries()
1 call to kaltura_remove_existing_entries()
kaltura_import_entries_page in includes/kaltura.admin.inc

File

includes/kaltura.admin.inc, line 656

Code

function kaltura_remove_existing_entries($entries) {
  $count = 0;
  $new_entries = array();
  if (is_array($entries) && count($entries)) {
    foreach ($entries as $entry) {
      $sel = 'SELECT COUNT(nid) n FROM {node_kaltura} WHERE kaltura_entryId = \'%s\'';
      $result = db_fetch_object(db_query($sel, $entry['id']));
      if ($result->n == 0) {
        $new_entries[] = $entry;
      }
      else {
        $count++;
      }
    }
  }
  return $new_entries;
}