function tripal_bulk_loader_delete_record

2.x tripal_bulk_loader.DEPRECATED.inc tripal_bulk_loader_delete_record($delete_priority, $template_array)
3.x tripal_bulk_loader.DEPRECATED.inc tripal_bulk_loader_delete_record($delete_priority, $template_array)
1.x tripal_bulk_loader.api.templates.inc tripal_bulk_loader_delete_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

2 calls to tripal_bulk_loader_delete_record()
tripal_bulk_loader_delete_field in tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc
An API function to delete a field from a template array
tripal_bulk_loader_modify_template_base_form_submit in tripal_bulk_loader/includes/tripal_bulk_loader.admin.templates.inc
Submit for tripal_bulk_loader_modify_template_base_form

File

tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc, line 74
All functions in this file provide an API to administrative management of bulk loader templates

Code

function tripal_bulk_loader_delete_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;
}