Browse Source

provide very simple label callback

bradfordcondon 7 years ago
parent
commit
8e26fcd62b
1 changed files with 17 additions and 0 deletions
  1. 17 0
      tripal/api/tripal.entities.api.inc

+ 17 - 0
tripal/api/tripal.entities.api.inc

@@ -1115,4 +1115,21 @@ function theme_token_list($tokens) {
   return theme('table', array('header' => $header, 'rows' => $rows));
 }
 
+/**
+ * Define the entity label callback.  This will return the title.
+ *
+ * @param $entity
+ *
+ * @return mixed
+ */
+
+function tripal_entity_label($entity) {
+  dpm($entity);
+  if (property_exists($entity, 'title')) {
+    return $entity->title;
+  }
+  return NULL;
+}
+
+