ParserInterface.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php
  2. namespace PicoFeed\Parser;
  3. use SimpleXMLElement;
  4. /**
  5. * Interface ParserInterface
  6. *
  7. * @package PicoFeed\Parser
  8. * @author Frederic Guillot
  9. */
  10. interface ParserInterface
  11. {
  12. /**
  13. * Find the feed url.
  14. *
  15. * @param SimpleXMLElement $xml Feed xml
  16. * @param Feed $feed Feed object
  17. */
  18. public function findFeedUrl(SimpleXMLElement $xml, Feed $feed);
  19. /**
  20. * Find the site url.
  21. *
  22. * @param SimpleXMLElement $xml Feed xml
  23. * @param Feed $feed Feed object
  24. */
  25. public function findSiteUrl(SimpleXMLElement $xml, Feed $feed);
  26. /**
  27. * Find the feed title.
  28. *
  29. * @param SimpleXMLElement $xml Feed xml
  30. * @param Feed $feed Feed object
  31. */
  32. public function findFeedTitle(SimpleXMLElement $xml, Feed $feed);
  33. /**
  34. * Find the feed description.
  35. *
  36. * @param SimpleXMLElement $xml Feed xml
  37. * @param Feed $feed Feed object
  38. */
  39. public function findFeedDescription(SimpleXMLElement $xml, Feed $feed);
  40. /**
  41. * Find the feed language.
  42. *
  43. * @param SimpleXMLElement $xml Feed xml
  44. * @param Feed $feed Feed object
  45. */
  46. public function findFeedLanguage(SimpleXMLElement $xml, Feed $feed);
  47. /**
  48. * Find the feed id.
  49. *
  50. * @param SimpleXMLElement $xml Feed xml
  51. * @param Feed $feed Feed object
  52. */
  53. public function findFeedId(SimpleXMLElement $xml, Feed $feed);
  54. /**
  55. * Find the feed date.
  56. *
  57. * @param SimpleXMLElement $xml Feed xml
  58. * @param Feed $feed Feed object
  59. */
  60. public function findFeedDate(SimpleXMLElement $xml, Feed $feed);
  61. /**
  62. * Find the feed logo url.
  63. *
  64. * @param SimpleXMLElement $xml Feed xml
  65. * @param Feed $feed Feed object
  66. */
  67. public function findFeedLogo(SimpleXMLElement $xml, Feed $feed);
  68. /**
  69. * Find the feed icon.
  70. *
  71. * @param SimpleXMLElement $xml Feed xml
  72. * @param Feed $feed Feed object
  73. */
  74. public function findFeedIcon(SimpleXMLElement $xml, Feed $feed);
  75. /**
  76. * Get the path to the items XML tree.
  77. *
  78. * @param SimpleXMLElement $xml Feed xml
  79. *
  80. * @return SimpleXMLElement
  81. */
  82. public function getItemsTree(SimpleXMLElement $xml);
  83. /**
  84. * Find the item author.
  85. *
  86. * @param SimpleXMLElement $xml Feed
  87. * @param SimpleXMLElement $entry Feed item
  88. * @param Item $item Item object
  89. */
  90. public function findItemAuthor(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item);
  91. /**
  92. * Find the item author URL.
  93. *
  94. * @param SimpleXMLElement $xml Feed
  95. * @param SimpleXMLElement $entry Feed item
  96. * @param Item $item Item object
  97. */
  98. public function findItemAuthorUrl(SimpleXMLElement $xml, SimpleXMLElement $entry, Item $item);
  99. /**
  100. * Find the item URL.
  101. *
  102. * @param SimpleXMLElement $entry Feed item
  103. * @param Item $item Item object
  104. */
  105. public function findItemUrl(SimpleXMLElement $entry, Item $item);
  106. /**
  107. * Find the item title.
  108. *
  109. * @param SimpleXMLElement $entry Feed item
  110. * @param Item $item Item object
  111. */
  112. public function findItemTitle(SimpleXMLElement $entry, Item $item);
  113. /**
  114. * Genereate the item id.
  115. *
  116. * @param SimpleXMLElement $entry Feed item
  117. * @param Item $item Item object
  118. * @param Feed $feed Feed object
  119. */
  120. public function findItemId(SimpleXMLElement $entry, Item $item, Feed $feed);
  121. /**
  122. * Find the item published date.
  123. *
  124. * @param SimpleXMLElement $entry Feed item
  125. * @param Item $item Item object
  126. * @param Feed $feed Feed object
  127. */
  128. public function findItemPublishedDate(SimpleXMLElement $entry, Item $item, Feed $feed);
  129. /**
  130. * Find the item updated date.
  131. *
  132. * @param SimpleXMLElement $entry Feed item
  133. * @param Item $item Item object
  134. * @param Feed $feed Feed object
  135. */
  136. public function findItemUpdatedDate(SimpleXMLElement $entry, Item $item, Feed $feed);
  137. /**
  138. * Find the item content.
  139. *
  140. * @param SimpleXMLElement $entry Feed item
  141. * @param Item $item Item object
  142. */
  143. public function findItemContent(SimpleXMLElement $entry, Item $item);
  144. /**
  145. * Find the item enclosure.
  146. *
  147. * @param SimpleXMLElement $entry Feed item
  148. * @param Item $item Item object
  149. * @param Feed $feed Feed object
  150. */
  151. public function findItemEnclosure(SimpleXMLElement $entry, Item $item, Feed $feed);
  152. /**
  153. * Find the item language.
  154. *
  155. * @param SimpleXMLElement $entry Feed item
  156. * @param Item $item Item object
  157. * @param Feed $feed Feed object
  158. */
  159. public function findItemLanguage(SimpleXMLElement $entry, Item $item, Feed $feed);
  160. /**
  161. * Find the item categories.
  162. *
  163. * @param SimpleXMLElement $entry Feed item
  164. * @param Item $item Item object
  165. * @param Feed $feed Feed object
  166. */
  167. public function findItemCategories(SimpleXMLElement $entry, Item $item, Feed $feed);
  168. }