3 namespace Drupal\media_entity;
5 use Drupal\Core\Entity\EntityChangedInterface;
6 use Drupal\Core\Entity\ContentEntityInterface;
7 use Drupal\Core\Entity\RevisionLogInterface;
10 * Provides an interface defining a media entity.
12 interface MediaInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface {
15 * Returns the media creation timestamp.
18 * Creation timestamp of the media.
20 public function getCreatedTime();
23 * Sets the media creation timestamp.
25 * @param int $timestamp
26 * The media creation timestamp.
28 * @return \Drupal\media_entity\MediaInterface
29 * The called media entity.
31 public function setCreatedTime($timestamp);
34 * Sets a flag to indicate the thumbnail will be retrieved via a queue.
36 public function setQueuedThumbnailDownload();
39 * Returns the media publisher user entity.
41 * @return \Drupal\user\UserInterface
42 * The author user entity.
44 public function getPublisher();
47 * Returns the media publisher user ID.
52 public function getPublisherId();
55 * Sets the media publisher user ID.
60 * @return \Drupal\media_entity\MediaInterface
61 * The called media entity.
63 public function setPublisherId($uid);
66 * Returns the media published status indicator.
68 * Unpublished media are only visible to their authors and to administrators.
71 * TRUE if the media is published.
73 public function isPublished();
76 * Sets the published status of a media.
78 * @param bool $published
79 * TRUE to set this media to published, FALSE to set it to unpublished.
81 * @return \Drupal\media_entity\MediaInterface
82 * The called media entity.
84 public function setPublished($published);
87 * Returns the media type.
89 * @return \Drupal\media_entity\MediaTypeInterface
92 public function getType();
95 * Automatically determines the most appropriate thumbnail and sets
98 public function automaticallySetThumbnail();