Browse Source

API: Updated bulk loader api to use the new naming rules

Lacey Sanderson 11 years ago
parent
commit
798c3edf97

+ 71 - 0
tripal_bulk_loader/api/tripal_bulk_loader.DEPRECATED.inc

@@ -0,0 +1,71 @@
+<?php
+/**
+ * @file
+ * Wrapper functions to provide backwards compatibility for the tripal analysis api
+ */
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_is_bulk_loader_record_name_unique().
+ *
+ * @see tripal_is_bulk_loader_record_name_unique().
+ */
+function tripal_bulk_loader_is_record_name_unique($new_record_name, $template_id, $template_array = NULL, $current_priority = NULL) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'tripal_bulk_loader_is_record_name_unique',
+      '%new_function' => 'tripal_is_bulk_loader_record_name_unique'
+    )
+  );
+
+  return tripal_is_bulk_loader_record_name_unique($new_record_name, $template_id, $template_array, $current_priority);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_delete_bulk_loader_record().
+ *
+ * @see tripal_delete_bulk_loader_record().
+ */
+function tripal_bulk_loader_delete_record($delete_priority, $template_array) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'tripal_bulk_loader_delete_record',
+      '%new_function' => 'tripal_delete_bulk_loader_record'
+    )
+  );
+
+  return tripal_delete_bulk_loader_record($delete_priority, $template_array);
+}
+
+/**
+ * @deprecated Restructured API to make naming more readable and consistent.
+ * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
+ * This function has been replaced by tripal_delete_bulk_loader_field().
+ *
+ * @see tripal_delete_bulk_loader_field().
+ */
+function tripal_bulk_loader_delete_field($priority, $delete_field_index, $template_array) {
+
+  tripal_report_error(
+    'tripal_deprecated',
+    TRIPAL_NOTICE,
+    "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
+    array(
+      '%old_function'=>'tripal_bulk_loader_delete_field',
+      '%new_function' => 'tripal_delete_bulk_loader_field'
+    )
+  );
+
+  return tripal_delete_bulk_loader_field($priority, $delete_field_index, $template_array);
+}

+ 3 - 3
tripal_bulk_loader/api/tripal_bulk_loader.api.templates.inc

@@ -32,7 +32,7 @@
  *
  * @ingroup tripal_bulk_loader_api
  */
-function tripal_bulk_loader_is_record_name_unique($new_record_name, $template_id, $template_array = NULL, $current_priority = NULL) {
+function tripal_is_bulk_loader_record_name_unique($new_record_name, $template_id, $template_array = NULL, $current_priority = NULL) {
 
   // get the template array if it's not supplied
   if (empty($template_array)) {
@@ -72,7 +72,7 @@ function tripal_bulk_loader_is_record_name_unique($new_record_name, $template_id
  *
  * @ingroup tripal_bulk_loader_api
  */
-function tripal_bulk_loader_delete_record($delete_priority, $template_array) {
+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');
@@ -106,7 +106,7 @@ function tripal_bulk_loader_delete_record($delete_priority, $template_array) {
  *
  * @ingroup tripal_bulk_loader_api
  */
-function tripal_bulk_loader_delete_field($priority, $delete_field_index, $template_array) {
+function tripal_delete_bulk_loader_field($priority, $delete_field_index, $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');

+ 7 - 6
tripal_bulk_loader/tripal_bulk_loader.module

@@ -15,18 +15,19 @@
  */
 
 // Loader
-include('includes/tripal_bulk_loader.loader.inc');
+require_once 'includes/tripal_bulk_loader.loader.inc';
 
 // Node
-include('includes/tripal_bulk_loader.chado_node.inc');
-include('includes/tripal_bulk_loader.constants.inc');
+require_once 'includes/tripal_bulk_loader.chado_node.inc';
+require_once 'includes/tripal_bulk_loader.constants.inc';
 
 // Administration
-include('includes/tripal_bulk_loader.admin.inc');
-include('includes/tripal_bulk_loader.admin.templates.inc');
+require_once 'includes/tripal_bulk_loader.admin.inc';
+require_once 'includes/tripal_bulk_loader.admin.templates.inc';
 
 // API
-include('api/tripal_bulk_loader.api.templates.inc');
+require_once 'api/tripal_bulk_loader.api.templates.inc';
+require_once 'api/tripal_bulk_loader.DEPRECATED.inc';
 
 /**
  * Implements hook_init().