| | 1 | <?php |
| | 2 | /** |
| | 3 | * Annotation to mark an entity as an item of an RSS feed. |
| | 4 | * |
| | 5 | * @author Frank Kleine <mikey@stubbles.net> |
| | 6 | * @package stubbles |
| | 7 | * @subpackage xml_rss |
| | 8 | * @version $Id$ |
| | 9 | */ |
| | 10 | stubClassLoader::load('net::stubbles::reflection::annotations::stubAbstractAnnotation'); |
| | 11 | /** |
| | 12 | * Annotation to mark an entity as an item of an RSS feed. |
| | 13 | * |
| | 14 | * @package stubbles |
| | 15 | * @subpackage xml_rss |
| | 16 | */ |
| | 17 | class stubRSSFeedItemAnnotation extends stubAbstractAnnotation |
| | 18 | { |
| | 19 | /** |
| | 20 | * name of method to return the title of the item |
| | 21 | * |
| | 22 | * @var string |
| | 23 | */ |
| | 24 | protected $titleMethod = 'getTitle'; |
| | 25 | /** |
| | 26 | * name of method to return the URL of the item |
| | 27 | * |
| | 28 | * @var string |
| | 29 | */ |
| | 30 | protected $linkMethod = 'getLink'; |
| | 31 | /** |
| | 32 | * name of method to return the item synopsis |
| | 33 | * |
| | 34 | * @var string |
| | 35 | */ |
| | 36 | protected $descriptionMethod = 'getDescription'; |
| | 37 | /** |
| | 38 | * name of method to return the email address of the author of the item |
| | 39 | * |
| | 40 | * @var string |
| | 41 | */ |
| | 42 | protected $authorMethod = 'getAuthor'; |
| | 43 | /** |
| | 44 | * name of method to return the categories where the item is included |
| | 45 | * |
| | 46 | * @var array |
| | 47 | */ |
| | 48 | protected $categoriesMethod = 'getCategories'; |
| | 49 | /** |
| | 50 | * name of method to return the URL of a page for comments relating to the item |
| | 51 | * |
| | 52 | * @var string |
| | 53 | */ |
| | 54 | protected $commentsMethod = 'getCommentsURL'; |
| | 55 | /** |
| | 56 | * name of method to return the describes a media object that is attached to the item |
| | 57 | * |
| | 58 | * @var array |
| | 59 | */ |
| | 60 | protected $enclosuresMethod = 'getEnclosures'; |
| | 61 | /** |
| | 62 | * name of method to return the unique identifier for the item |
| | 63 | * |
| | 64 | * @var string |
| | 65 | */ |
| | 66 | protected $guidMethod = 'getGuid'; |
| | 67 | /** |
| | 68 | * name of method to return the whether the id may be interpreted as a permanent link or not |
| | 69 | * |
| | 70 | * @var bool |
| | 71 | */ |
| | 72 | protected $isPermaLinkMethod = 'isPermaLink'; |
| | 73 | /** |
| | 74 | * name of method to return the date when the item was published |
| | 75 | * |
| | 76 | * @var string |
| | 77 | */ |
| | 78 | protected $pubDateMethod = 'getPubDate'; |
| | 79 | /** |
| | 80 | * name of method to return the where that the item came from |
| | 81 | * |
| | 82 | * @var array |
| | 83 | */ |
| | 84 | protected $sourcesMethod = 'getSources'; |
| | 85 | /** |
| | 86 | * name of method to return the content of rss feed item |
| | 87 | * |
| | 88 | * @var string |
| | 89 | */ |
| | 90 | protected $contentMethod = 'getContent'; |
| | 91 | |
| | 92 | /** |
| | 93 | * returns the target of the annotation as bitmap |
| | 94 | * |
| | 95 | * @return int |
| | 96 | */ |
| | 97 | public function getAnnotationTarget() |
| | 98 | { |
| | 99 | return stubAnnotation::TARGET_CLASS; |
| | 100 | } |
| | 101 | |
| | 102 | /** |
| | 103 | * sets the name of method to return the title of the item |
| | 104 | * |
| | 105 | * @param string $titleMethod |
| | 106 | */ |
| | 107 | public function setTitleMethod($titleMethod) |
| | 108 | { |
| | 109 | $this->titleMethod = $titleMethod; |
| | 110 | } |
| | 111 | |
| | 112 | /** |
| | 113 | * returns the name of method to return the title of the item |
| | 114 | * |
| | 115 | * @return string |
| | 116 | */ |
| | 117 | public function getTitleMethod() |
| | 118 | { |
| | 119 | return $this->titleMethod; |
| | 120 | } |
| | 121 | |
| | 122 | /** |
| | 123 | * sets the name of method to return the URL of the item |
| | 124 | * |
| | 125 | * @param string $linkMethod |
| | 126 | */ |
| | 127 | public function setLinkMethod($linkMethod) |
| | 128 | { |
| | 129 | $this->linkMethod = $linkMethod; |
| | 130 | } |
| | 131 | |
| | 132 | /** |
| | 133 | * returns the name of method to return the URL of the item |
| | 134 | * |
| | 135 | * @return string |
| | 136 | */ |
| | 137 | public function getLinkMethod() |
| | 138 | { |
| | 139 | return $this->linkMethod; |
| | 140 | } |
| | 141 | |
| | 142 | /** |
| | 143 | * sets the name of method to return the item synopsis |
| | 144 | * |
| | 145 | * @param string $descriptionMethod |
| | 146 | */ |
| | 147 | public function setDescriptionMethod($descriptionMethod) |
| | 148 | { |
| | 149 | $this->descriptionMethod = $descriptionMethod; |
| | 150 | } |
| | 151 | |
| | 152 | /** |
| | 153 | * returns the name of method to return the item synopsis |
| | 154 | * |
| | 155 | * @return string |
| | 156 | */ |
| | 157 | public function getDescriptionMethod() |
| | 158 | { |
| | 159 | return $this->descriptionMethod; |
| | 160 | } |
| | 161 | |
| | 162 | /** |
| | 163 | * sets the name of method to return the email address of the author of the item |
| | 164 | * |
| | 165 | * @param string $authorMethod |
| | 166 | */ |
| | 167 | public function setAuthorMethod($authorMethod) |
| | 168 | { |
| | 169 | $this->authorMethod = $authorMethod; |
| | 170 | } |
| | 171 | |
| | 172 | /** |
| | 173 | * returns the name of method to return the email address of the author of the item |
| | 174 | * |
| | 175 | * @return string |
| | 176 | */ |
| | 177 | public function getAuthorMethod() |
| | 178 | { |
| | 179 | return $this->authorMethod; |
| | 180 | } |
| | 181 | |
| | 182 | /** |
| | 183 | * sets the name of method to return the date when the item was published |
| | 184 | * |
| | 185 | * @param string $pubDateMethod |
| | 186 | */ |
| | 187 | public function setPubDateMethod($pubDateMethod) |
| | 188 | { |
| | 189 | $this->pubDateMethod = $pubDateMethod; |
| | 190 | } |
| | 191 | |
| | 192 | /** |
| | 193 | * returns the name of method to return the date when the item was published |
| | 194 | * |
| | 195 | * @return string |
| | 196 | */ |
| | 197 | public function getPubDateMethod() |
| | 198 | { |
| | 199 | return $this->pubDateMethod; |
| | 200 | } |
| | 201 | } |
| | 202 | ?> |
| | 203 | No newline at end of file |