3 namespace Drupal\media;
5 use Drupal\Core\Entity\EntityChangedInterface;
6 use Drupal\Core\Entity\ContentEntityInterface;
7 use Drupal\Core\Entity\EntityPublishedInterface;
8 use Drupal\Core\Entity\RevisionLogInterface;
9 use Drupal\user\EntityOwnerInterface;
12 * Provides an interface defining an entity for media items.
14 interface MediaInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityOwnerInterface, EntityPublishedInterface {
17 * Gets the media item name.
20 * The name of the media item.
22 public function getName();
25 * Sets the media item name.
28 * The name of the media item.
32 public function setName($name);
35 * Returns the media item creation timestamp.
37 * @todo Remove and use the new interface when #2833378 is done.
38 * @see https://www.drupal.org/node/2833378
41 * Creation timestamp of the media item.
43 public function getCreatedTime();
46 * Sets the media item creation timestamp.
48 * @todo Remove and use the new interface when #2833378 is done.
49 * @see https://www.drupal.org/node/2833378
51 * @param int $timestamp
52 * The media creation timestamp.
54 * @return \Drupal\media\MediaInterface
55 * The called media item.
57 public function setCreatedTime($timestamp);
60 * Returns the media source.
62 * @return \Drupal\media\MediaSourceInterface
65 public function getSource();