annotate core/modules/aggregator/src/FeedInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\aggregator;
Chris@0 4
Chris@0 5 use Drupal\Core\Entity\ContentEntityInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Provides an interface defining an aggregator feed entity.
Chris@0 9 */
Chris@0 10 interface FeedInterface extends ContentEntityInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Sets the title of the feed.
Chris@0 14 *
Chris@0 15 * @param string $title
Chris@0 16 * The short title of the feed.
Chris@0 17 *
Chris@0 18 * @return \Drupal\aggregator\FeedInterface
Chris@0 19 * The class instance that this method is called on.
Chris@0 20 */
Chris@0 21 public function setTitle($title);
Chris@0 22
Chris@0 23 /**
Chris@0 24 * Returns the url to the feed.
Chris@0 25 *
Chris@0 26 * @return string
Chris@0 27 * The url to the feed.
Chris@0 28 */
Chris@0 29 public function getUrl();
Chris@0 30
Chris@0 31 /**
Chris@0 32 * Sets the url to the feed.
Chris@0 33 *
Chris@0 34 * @param string $url
Chris@0 35 * A string containing the url of the feed.
Chris@0 36 *
Chris@0 37 * @return \Drupal\aggregator\FeedInterface
Chris@0 38 * The class instance that this method is called on.
Chris@0 39 */
Chris@0 40 public function setUrl($url);
Chris@0 41
Chris@0 42 /**
Chris@0 43 * Returns the refresh rate of the feed in seconds.
Chris@0 44 *
Chris@0 45 * @return int
Chris@0 46 * The refresh rate of the feed in seconds.
Chris@0 47 */
Chris@0 48 public function getRefreshRate();
Chris@0 49
Chris@0 50 /**
Chris@0 51 * Sets the refresh rate of the feed in seconds.
Chris@0 52 *
Chris@0 53 * @param int $refresh
Chris@0 54 * The refresh rate of the feed in seconds.
Chris@0 55 *
Chris@0 56 * @return \Drupal\aggregator\FeedInterface
Chris@0 57 * The class instance that this method is called on.
Chris@0 58 */
Chris@0 59 public function setRefreshRate($refresh);
Chris@0 60
Chris@0 61 /**
Chris@0 62 * Returns the last time where the feed was checked for new items.
Chris@0 63 *
Chris@0 64 * @return int
Chris@0 65 * The timestamp when new items were last checked for.
Chris@0 66 */
Chris@0 67 public function getLastCheckedTime();
Chris@0 68
Chris@0 69 /**
Chris@0 70 * Sets the time when this feed was queued for refresh, 0 if not queued.
Chris@0 71 *
Chris@0 72 * @param int $checked
Chris@0 73 * The timestamp of the last refresh.
Chris@0 74 *
Chris@0 75 * @return \Drupal\aggregator\FeedInterface
Chris@0 76 * The class instance that this method is called on.
Chris@0 77 */
Chris@0 78 public function setLastCheckedTime($checked);
Chris@0 79
Chris@0 80 /**
Chris@0 81 * Returns the time when this feed was queued for refresh, 0 if not queued.
Chris@0 82 *
Chris@0 83 * @return int
Chris@0 84 * The timestamp of the last refresh.
Chris@0 85 */
Chris@0 86 public function getQueuedTime();
Chris@0 87
Chris@0 88 /**
Chris@0 89 * Sets the time when this feed was queued for refresh, 0 if not queued.
Chris@0 90 *
Chris@0 91 * @param int $queued
Chris@0 92 * The timestamp of the last refresh.
Chris@0 93 *
Chris@0 94 * @return \Drupal\aggregator\FeedInterface
Chris@0 95 * The class instance that this method is called on.
Chris@0 96 */
Chris@0 97 public function setQueuedTime($queued);
Chris@0 98
Chris@0 99 /**
Chris@0 100 * Returns the parent website of the feed.
Chris@0 101 *
Chris@0 102 * @return string
Chris@0 103 * The parent website of the feed.
Chris@0 104 */
Chris@0 105 public function getWebsiteUrl();
Chris@0 106
Chris@0 107 /**
Chris@0 108 * Sets the parent website of the feed.
Chris@0 109 *
Chris@0 110 * @param string $link
Chris@0 111 * A string containing the parent website of the feed.
Chris@0 112 *
Chris@0 113 * @return \Drupal\aggregator\FeedInterface
Chris@0 114 * The class instance that this method is called on.
Chris@0 115 */
Chris@0 116 public function setWebsiteUrl($link);
Chris@0 117
Chris@0 118 /**
Chris@0 119 * Returns the description of the feed.
Chris@0 120 *
Chris@0 121 * @return string
Chris@0 122 * The description of the feed.
Chris@0 123 */
Chris@0 124 public function getDescription();
Chris@0 125
Chris@0 126 /**
Chris@0 127 * Sets the description of the feed.
Chris@0 128 *
Chris@0 129 * @param string $description
Chris@0 130 * The description of the feed.
Chris@0 131 *
Chris@0 132 * @return \Drupal\aggregator\FeedInterface
Chris@0 133 * The class instance that this method is called on.
Chris@0 134 */
Chris@0 135 public function setDescription($description);
Chris@0 136
Chris@0 137 /**
Chris@0 138 * Returns the primary image attached to the feed.
Chris@0 139 *
Chris@0 140 * @return string
Chris@0 141 * The URL of the primary image attached to the feed.
Chris@0 142 */
Chris@0 143 public function getImage();
Chris@0 144
Chris@0 145 /**
Chris@0 146 * Sets the primary image attached to the feed.
Chris@0 147 *
Chris@0 148 * @param string $image
Chris@0 149 * An image URL.
Chris@0 150 *
Chris@0 151 * @return \Drupal\aggregator\FeedInterface
Chris@0 152 * The class instance that this method is called on.
Chris@0 153 */
Chris@0 154 public function setImage($image);
Chris@0 155
Chris@0 156 /**
Chris@0 157 * Returns the calculated hash of the feed data, used for validating cache.
Chris@0 158 *
Chris@0 159 * @return string
Chris@0 160 * The calculated hash of the feed data.
Chris@0 161 */
Chris@0 162 public function getHash();
Chris@0 163
Chris@0 164 /**
Chris@0 165 * Sets the calculated hash of the feed data, used for validating cache.
Chris@0 166 *
Chris@0 167 * @param string $hash
Chris@0 168 * A string containing the calculated hash of the feed. Must contain
Chris@0 169 * US ASCII characters only.
Chris@0 170 *
Chris@0 171 * @return \Drupal\aggregator\FeedInterface
Chris@0 172 * The class instance that this method is called on.
Chris@0 173 */
Chris@0 174 public function setHash($hash);
Chris@0 175
Chris@0 176 /**
Chris@0 177 * Returns the entity tag HTTP response header, used for validating cache.
Chris@0 178 *
Chris@0 179 * @return string
Chris@0 180 * The entity tag HTTP response header.
Chris@0 181 */
Chris@0 182 public function getEtag();
Chris@0 183
Chris@0 184 /**
Chris@0 185 * Sets the entity tag HTTP response header, used for validating cache.
Chris@0 186 *
Chris@0 187 * @param string $etag
Chris@0 188 * A string containing the entity tag HTTP response header.
Chris@0 189 *
Chris@0 190 * @return \Drupal\aggregator\FeedInterface
Chris@0 191 * The class instance that this method is called on.
Chris@0 192 */
Chris@0 193 public function setEtag($etag);
Chris@0 194
Chris@0 195 /**
Chris@0 196 * Return when the feed was modified last time.
Chris@0 197 *
Chris@0 198 * @return int
Chris@0 199 * The timestamp of the last time the feed was modified.
Chris@0 200 */
Chris@0 201 public function getLastModified();
Chris@0 202
Chris@0 203 /**
Chris@0 204 * Sets the last modification of the feed.
Chris@0 205 *
Chris@0 206 * @param int $modified
Chris@0 207 * The timestamp when the feed was modified.
Chris@0 208 *
Chris@0 209 * @return \Drupal\aggregator\FeedInterface
Chris@0 210 * The class instance that this method is called on.
Chris@0 211 */
Chris@0 212 public function setLastModified($modified);
Chris@0 213
Chris@0 214 /**
Chris@0 215 * Deletes all items from a feed.
Chris@0 216 *
Chris@0 217 * This will also reset the last checked and modified time of the feed and
Chris@0 218 * save it.
Chris@0 219 *
Chris@0 220 * @return \Drupal\aggregator\FeedInterface
Chris@0 221 * The class instance that this method is called on.
Chris@0 222 *
Chris@0 223 * @see \Drupal\aggregator\ItemsImporterInterface::delete()
Chris@0 224 */
Chris@0 225 public function deleteItems();
Chris@0 226
Chris@0 227 /**
Chris@0 228 * Updates the feed items by triggering the import process.
Chris@0 229 *
Chris@0 230 * This will also update the last checked time of the feed and save it.
Chris@0 231 *
Chris@0 232 * @return bool
Chris@0 233 * TRUE if there is new content for the feed FALSE otherwise.
Chris@0 234 *
Chris@0 235 * @see \Drupal\aggregator\ItemsImporterInterface::refresh()
Chris@0 236 */
Chris@0 237 public function refreshItems();
Chris@0 238
Chris@0 239 }