summaryrefslogtreecommitdiffstats
path: root/core/modules/content_moderation/content_moderation.views.inc
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-08-08 12:26:31 (GMT)
committerNathaniel Catchpole2016-08-08 12:26:31 (GMT)
commitbc00f081e6b8e35e3b7ee57eb963b7e5b92593a2 (patch)
tree7b8ceb1d56763d8bccff57583b4318334d7dabcf /core/modules/content_moderation/content_moderation.views.inc
parente1ef487b8d010367dc2325595a0c65d31cd71c7a (diff)
Issue #2725533 by timmillwood, alexpott, amateescu, webchick, dixon_, larowlan, dawehner, catch, Crell, Bojhan, jibran, Wim Leers, agentrickard, Berdir: Add experimental content_moderation module
Diffstat (limited to 'core/modules/content_moderation/content_moderation.views.inc')
-rw-r--r--core/modules/content_moderation/content_moderation.views.inc37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/modules/content_moderation/content_moderation.views.inc b/core/modules/content_moderation/content_moderation.views.inc
new file mode 100644
index 0000000..faabc6a
--- /dev/null
+++ b/core/modules/content_moderation/content_moderation.views.inc
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Provide views data for content_moderation.module.
+ *
+ * @ingroup views_module_handlers
+ */
+
+use Drupal\content_moderation\ViewsData;
+
+/**
+ * Implements hook_views_data().
+ */
+function content_moderation_views_data() {
+ return _content_moderation_views_data_object()->getViewsData();
+}
+
+/**
+ * Implements hook_views_data_alter().
+ */
+function content_moderation_views_data_alter(array &$data) {
+ _content_moderation_views_data_object()->alterViewsData($data);
+}
+
+/**
+ * Creates a ViewsData object to respond to views hooks.
+ *
+ * @return \Drupal\content_moderation\ViewsData
+ * The content moderation ViewsData object.
+ */
+function _content_moderation_views_data_object() {
+ return new ViewsData(
+ \Drupal::service('entity_type.manager'),
+ \Drupal::service('content_moderation.moderation_information')
+ );
+}