ItemInterface.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. namespace Suin\RSSWriter;
  3. /**
  4. * Interface ItemInterface
  5. * @package Suin\RSSWriter
  6. */
  7. interface ItemInterface
  8. {
  9. /**
  10. * Set item title
  11. * @param string $title
  12. * @return $this
  13. */
  14. public function title($title);
  15. /**
  16. * Set item URL
  17. * @param string $url
  18. * @return $this
  19. */
  20. public function url($url);
  21. /**
  22. * Set item description
  23. * @param string $description
  24. * @return $this
  25. */
  26. public function description($description);
  27. /**
  28. * Set content:encoded
  29. * @param string $content
  30. * @return $this
  31. */
  32. public function contentEncoded($content);
  33. /**
  34. * Set item category
  35. * @param string $name Category name
  36. * @param string $domain Category URL
  37. * @return $this
  38. */
  39. public function category($name, $domain = null);
  40. /**
  41. * Set GUID
  42. * @param string $guid
  43. * @param bool $isPermalink
  44. * @return $this
  45. */
  46. public function guid($guid, $isPermalink = false);
  47. /**
  48. * Set published date
  49. * @param int $pubDate Unix timestamp
  50. * @return $this
  51. */
  52. public function pubDate($pubDate);
  53. /**
  54. * Set enclosure
  55. * @param string $url Url to media file
  56. * @param int $length Length in bytes of the media file
  57. * @param string $type Media type, default is audio/mpeg
  58. * @return $this
  59. */
  60. public function enclosure($url, $length = 0, $type = 'audio/mpeg');
  61. /**
  62. * Set the author
  63. * @param string $author Email of item author
  64. * @return $this
  65. */
  66. public function author($author);
  67. /**
  68. * Append item to the channel
  69. * @param \Suin\RSSWriter\ChannelInterface $channel
  70. * @return $this
  71. */
  72. public function appendTo(ChannelInterface $channel);
  73. /**
  74. * Return XML object
  75. * @return \Suin\RSSWriter\SimpleXMLElement
  76. */
  77. public function asXML();
  78. }