Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EditorialContentEntityBase.php
diff --git a/web/core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php b/web/core/lib/Drupal/Core/Entity/EditorialContentEntityBase.php
new file mode 100644 (file)
index 0000000..ff6abcd
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+namespace Drupal\Core\Entity;
+
+/**
+ * Provides a base entity class with extended revision and publishing support.
+ *
+ * @ingroup entity_api
+ */
+abstract class EditorialContentEntityBase extends ContentEntityBase implements EntityChangedInterface, EntityPublishedInterface, RevisionLogInterface {
+
+  use EntityChangedTrait;
+  use EntityPublishedTrait;
+  use RevisionLogEntityTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
+    $fields = parent::baseFieldDefinitions($entity_type);
+
+    // Add the revision metadata fields.
+    $fields += static::revisionLogBaseFieldDefinitions($entity_type);
+
+    // Add the published field.
+    $fields += static::publishedBaseFieldDefinitions($entity_type);
+
+    return $fields;
+  }
+
+}