summaryrefslogtreecommitdiffstats
path: root/core/modules/media/src/MediaInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/media/src/MediaInterface.php')
-rw-r--r--core/modules/media/src/MediaInterface.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/core/modules/media/src/MediaInterface.php b/core/modules/media/src/MediaInterface.php
new file mode 100644
index 0000000..7064441
--- /dev/null
+++ b/core/modules/media/src/MediaInterface.php
@@ -0,0 +1,49 @@
+<?php
+
+namespace Drupal\media;
+
+use Drupal\Core\Entity\EntityChangedInterface;
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\EntityPublishedInterface;
+use Drupal\Core\Entity\RevisionLogInterface;
+use Drupal\user\EntityOwnerInterface;
+
+/**
+ * Provides an interface defining an entity for media items.
+ */
+interface MediaInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityOwnerInterface, EntityPublishedInterface {
+
+ /**
+ * Returns the media item creation timestamp.
+ *
+ * @todo Remove and use the new interface when #2833378 is done.
+ * @see https://www.drupal.org/node/2833378
+ *
+ * @return int
+ * Creation timestamp of the media item.
+ */
+ public function getCreatedTime();
+
+ /**
+ * Sets the media item creation timestamp.
+ *
+ * @todo Remove and use the new interface when #2833378 is done.
+ * @see https://www.drupal.org/node/2833378
+ *
+ * @param int $timestamp
+ * The media creation timestamp.
+ *
+ * @return \Drupal\media\MediaInterface
+ * The called media item.
+ */
+ public function setCreatedTime($timestamp);
+
+ /**
+ * Returns the media source.
+ *
+ * @return \Drupal\media\MediaSourceInterface
+ * The media source.
+ */
+ public function getSource();
+
+}