function tripal_delete_bulk_loader_record

2.x tripal_bulk_loader.api.templates.inc tripal_delete_bulk_loader_record($delete_priority, $template_array)

An API function to delete a record from a template array

Parameters

$delete_priority: The priority of the record to be deleted

$template_array: The array describing the template

Return value

The modified template array

Related topics

3 calls to tripal_delete_bulk_loader_record()
tripal_bulk_loader_delete_record in tripal_bulk_loader/api/tripal_bulk_loader.DEPRECATED.inc
tripal_bulk_loader_delete_template_record_form_submit in tripal_bulk_loader/includes/tripal_bulk_loader.admin.templates.inc
Delete Record Form
tripal_delete_bulk_loader_field in tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc
An API function to delete a field from a template array
1 string reference to 'tripal_delete_bulk_loader_record'

File

tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc, line 238
Provides functions for hooking into bulk loader functionality.

Code

function tripal_delete_bulk_loader_record($delete_priority, $template_array) {

  if (empty($template_array)) {
    drupal_set_message("Unable to delete record with a priority of $priority since the template was not supplied", 'error');
    return FALSE;
  }

  $new_template_array = array();
  $i = 0;
  foreach ($template_array as $priority => $record) {
    if ($priority != $delete_priority) {
      $new_template_array[$i] = $record;
      $i++;
    }
  }

  return $new_template_array;
}