MediaInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace Drupal\media;
  3. use Drupal\Core\Entity\EntityChangedInterface;
  4. use Drupal\Core\Entity\ContentEntityInterface;
  5. use Drupal\Core\Entity\EntityPublishedInterface;
  6. use Drupal\Core\Entity\RevisionLogInterface;
  7. use Drupal\user\EntityOwnerInterface;
  8. /**
  9. * Provides an interface defining an entity for media items.
  10. */
  11. interface MediaInterface extends ContentEntityInterface, EntityChangedInterface, RevisionLogInterface, EntityOwnerInterface, EntityPublishedInterface {
  12. /**
  13. * Gets the media item name.
  14. *
  15. * @return string
  16. * The name of the media item.
  17. */
  18. public function getName();
  19. /**
  20. * Sets the media item name.
  21. *
  22. * @param string $name
  23. * The name of the media item.
  24. *
  25. * @return $this
  26. */
  27. public function setName($name);
  28. /**
  29. * Returns the media item creation timestamp.
  30. *
  31. * @todo Remove and use the new interface when #2833378 is done.
  32. * @see https://www.drupal.org/node/2833378
  33. *
  34. * @return int
  35. * Creation timestamp of the media item.
  36. */
  37. public function getCreatedTime();
  38. /**
  39. * Sets the media item creation timestamp.
  40. *
  41. * @todo Remove and use the new interface when #2833378 is done.
  42. * @see https://www.drupal.org/node/2833378
  43. *
  44. * @param int $timestamp
  45. * The media creation timestamp.
  46. *
  47. * @return \Drupal\media\MediaInterface
  48. * The called media item.
  49. */
  50. public function setCreatedTime($timestamp);
  51. /**
  52. * Returns the media source.
  53. *
  54. * @return \Drupal\media\MediaSourceInterface
  55. * The media source.
  56. */
  57. public function getSource();
  58. }