Version 1
[yaffs-website] / web / core / modules / field_ui / src / EntityFormModeListBuilder.php
diff --git a/web/core/modules/field_ui/src/EntityFormModeListBuilder.php b/web/core/modules/field_ui/src/EntityFormModeListBuilder.php
new file mode 100644 (file)
index 0000000..6cab12f
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Drupal\field_ui;
+
+/**
+ * Defines a class to build a listing of form mode entities.
+ *
+ * @see \Drupal\Core\Entity\Entity\EntityFormMode
+ */
+class EntityFormModeListBuilder extends EntityDisplayModeListBuilder {
+
+  /**
+   * Filters entities based on their form mode handlers.
+   *
+   * @param $entity_type
+   *   The entity type of the entity that needs to be validated.
+   *
+   * @return bool
+   *   TRUE if the entity has any forms, FALSE otherwise.
+   */
+  protected function isValidEntity($entity_type) {
+    return $this->entityTypes[$entity_type]->hasFormClasses();
+  }
+
+}