Browse Source

Adding file forgot to commit

Stephen Ficklin 8 years ago
parent
commit
a68b58b726
1 changed files with 28 additions and 0 deletions
  1. 28 0
      tripal/includes/TripalBundleViewsController.inc

+ 28 - 0
tripal/includes/TripalBundleViewsController.inc

@@ -0,0 +1,28 @@
+<?php
+/**
+ *
+ */
+class TripalBundleViewsController extends EntityDefaultViewsController {
+
+  /**
+   * Edit or add extra fields to views_data().
+   */
+  public function views_data() {
+    $data = parent::views_data();
+
+    // Join the bundle to it's entity.
+    $data['tripal_bundle']['table']['join']['tripal_entity'] = array(
+      'handler' => 'views_join',
+      'left_field' => 'bundle',
+      'field' => 'name',
+    );
+
+    // This should not be a base table. It's not useful to create a
+    // view of the bundles.
+    unset($data['tripal_bundle']['table']['base']);
+
+
+    return $data;
+  }
+
+}