Version 1
[yaffs-website] / web / modules / contrib / fontyourface / src / Entity / FontViewsData.php
diff --git a/web/modules/contrib/fontyourface/src/Entity/FontViewsData.php b/web/modules/contrib/fontyourface/src/Entity/FontViewsData.php
new file mode 100644 (file)
index 0000000..7489637
--- /dev/null
@@ -0,0 +1,34 @@
+<?php
+
+namespace Drupal\fontyourface\Entity;
+
+use Drupal\views\EntityViewsData;
+use Drupal\views\EntityViewsDataInterface;
+
+/**
+ * Provides Views data for Font entities.
+ */
+class FontViewsData extends EntityViewsData implements EntityViewsDataInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getViewsData() {
+    $data = parent::getViewsData();
+
+    $data['fontyourface_font']['pid']['filter'] = [
+      'id' => 'fontyourface_font_pid',
+    ];
+
+    $data['fontyourface_font']['css_style']['filter'] = [
+      'id' => 'fontyourface_font_style',
+    ];
+
+    $data['fontyourface_font']['css_weight']['filter'] = [
+      'id' => 'fontyourface_font_weight',
+    ];
+
+    return $data;
+  }
+
+}