Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / media_entity / src / MediaInterface.php
1 <?php
2
3 namespace Drupal\media_entity;
4
5 use Drupal\Core\Entity\EntityChangedInterface;
6 use Drupal\Core\Entity\ContentEntityInterface;
7 use Drupal\Core\Entity\RevisionLogInterface;
8
9 /**
10  * Provides an interface defining a media entity.
11  */
12 interface MediaInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface {
13
14   /**
15    * Returns the media creation timestamp.
16    *
17    * @return int
18    *   Creation timestamp of the media.
19    */
20   public function getCreatedTime();
21
22   /**
23    * Sets the media creation timestamp.
24    *
25    * @param int $timestamp
26    *   The media creation timestamp.
27    *
28    * @return \Drupal\media_entity\MediaInterface
29    *   The called media entity.
30    */
31   public function setCreatedTime($timestamp);
32
33   /**
34    * Sets a flag to indicate the thumbnail will be retrieved via a queue.
35    */
36   public function setQueuedThumbnailDownload();
37
38   /**
39    * Returns the media publisher user entity.
40    *
41    * @return \Drupal\user\UserInterface
42    *   The author user entity.
43    */
44   public function getPublisher();
45
46   /**
47    * Returns the media publisher user ID.
48    *
49    * @return int
50    *   The author user ID.
51    */
52   public function getPublisherId();
53
54   /**
55    * Sets the media publisher user ID.
56    *
57    * @param int $uid
58    *   The author user id.
59    *
60    * @return \Drupal\media_entity\MediaInterface
61    *   The called media entity.
62    */
63   public function setPublisherId($uid);
64
65   /**
66    * Returns the media published status indicator.
67    *
68    * Unpublished media are only visible to their authors and to administrators.
69    *
70    * @return bool
71    *   TRUE if the media is published.
72    */
73   public function isPublished();
74
75   /**
76    * Sets the published status of a media.
77    *
78    * @param bool $published
79    *   TRUE to set this media to published, FALSE to set it to unpublished.
80    *
81    * @return \Drupal\media_entity\MediaInterface
82    *   The called media entity.
83    */
84   public function setPublished($published);
85
86   /**
87    * Returns the media type.
88    *
89    * @return \Drupal\media_entity\MediaTypeInterface
90    *   The media type.
91    */
92   public function getType();
93
94   /**
95    * Automatically determines the most appropriate thumbnail and sets
96    * "thumbnail" field.
97    */
98   public function automaticallySetThumbnail();
99
100 }