3 namespace Drupal\aggregator;
5 use Drupal\Core\Entity\ContentEntityInterface;
8 * Provides an interface defining an aggregator feed entity.
10 interface FeedInterface extends ContentEntityInterface {
13 * Sets the title of the feed.
15 * @param string $title
16 * The short title of the feed.
18 * @return \Drupal\aggregator\FeedInterface
19 * The class instance that this method is called on.
21 public function setTitle($title);
24 * Returns the url to the feed.
27 * The url to the feed.
29 public function getUrl();
32 * Sets the url to the feed.
35 * A string containing the url of the feed.
37 * @return \Drupal\aggregator\FeedInterface
38 * The class instance that this method is called on.
40 public function setUrl($url);
43 * Returns the refresh rate of the feed in seconds.
46 * The refresh rate of the feed in seconds.
48 public function getRefreshRate();
51 * Sets the refresh rate of the feed in seconds.
54 * The refresh rate of the feed in seconds.
56 * @return \Drupal\aggregator\FeedInterface
57 * The class instance that this method is called on.
59 public function setRefreshRate($refresh);
62 * Returns the last time where the feed was checked for new items.
65 * The timestamp when new items were last checked for.
67 public function getLastCheckedTime();
70 * Sets the time when this feed was queued for refresh, 0 if not queued.
73 * The timestamp of the last refresh.
75 * @return \Drupal\aggregator\FeedInterface
76 * The class instance that this method is called on.
78 public function setLastCheckedTime($checked);
81 * Returns the time when this feed was queued for refresh, 0 if not queued.
84 * The timestamp of the last refresh.
86 public function getQueuedTime();
89 * Sets the time when this feed was queued for refresh, 0 if not queued.
92 * The timestamp of the last refresh.
94 * @return \Drupal\aggregator\FeedInterface
95 * The class instance that this method is called on.
97 public function setQueuedTime($queued);
100 * Returns the parent website of the feed.
103 * The parent website of the feed.
105 public function getWebsiteUrl();
108 * Sets the parent website of the feed.
110 * @param string $link
111 * A string containing the parent website of the feed.
113 * @return \Drupal\aggregator\FeedInterface
114 * The class instance that this method is called on.
116 public function setWebsiteUrl($link);
119 * Returns the description of the feed.
122 * The description of the feed.
124 public function getDescription();
127 * Sets the description of the feed.
129 * @param string $description
130 * The description of the feed.
132 * @return \Drupal\aggregator\FeedInterface
133 * The class instance that this method is called on.
135 public function setDescription($description);
138 * Returns the primary image attached to the feed.
141 * The URL of the primary image attached to the feed.
143 public function getImage();
146 * Sets the primary image attached to the feed.
148 * @param string $image
151 * @return \Drupal\aggregator\FeedInterface
152 * The class instance that this method is called on.
154 public function setImage($image);
157 * Returns the calculated hash of the feed data, used for validating cache.
160 * The calculated hash of the feed data.
162 public function getHash();
165 * Sets the calculated hash of the feed data, used for validating cache.
167 * @param string $hash
168 * A string containing the calculated hash of the feed. Must contain
169 * US ASCII characters only.
171 * @return \Drupal\aggregator\FeedInterface
172 * The class instance that this method is called on.
174 public function setHash($hash);
177 * Returns the entity tag HTTP response header, used for validating cache.
180 * The entity tag HTTP response header.
182 public function getEtag();
185 * Sets the entity tag HTTP response header, used for validating cache.
187 * @param string $etag
188 * A string containing the entity tag HTTP response header.
190 * @return \Drupal\aggregator\FeedInterface
191 * The class instance that this method is called on.
193 public function setEtag($etag);
196 * Return when the feed was modified last time.
199 * The timestamp of the last time the feed was modified.
201 public function getLastModified();
204 * Sets the last modification of the feed.
206 * @param int $modified
207 * The timestamp when the feed was modified.
209 * @return \Drupal\aggregator\FeedInterface
210 * The class instance that this method is called on.
212 public function setLastModified($modified);
215 * Deletes all items from a feed.
217 * This will also reset the last checked and modified time of the feed and
220 * @return \Drupal\aggregator\FeedInterface
221 * The class instance that this method is called on.
223 * @see \Drupal\aggregator\ItemsImporterInterface::delete()
225 public function deleteItems();
228 * Updates the feed items by triggering the import process.
230 * This will also update the last checked time of the feed and save it.
233 * TRUE if there is new content for the feed FALSE otherwise.
235 * @see \Drupal\aggregator\ItemsImporterInterface::refresh()
237 public function refreshItems();