[ Index ] |
|
Code source de LifeType 1.2.4 |
1 <?php 2 3 4 5 /** 6 * \ingroup XML 7 * 8 * <p>Provides information about an RSS channel, fetched from an RSS resource.</p> 9 * <p>This class provides methods to get the value of some of the attributes and possible child 10 * tags of the <channel< tag. In case we need to know about any other value that is not available 11 * via one of the 'getter' functions (getTitle(), getDescription(), getLink()), we can then get 12 * values from the resulting array as generated by the underlying RSS parser using the get() function. 13 * The array is an associative array where the keys are the name of the attribute/tag and the values are 14 * the value of the attribute/tag.</p> 15 */ 16 class RSSChannel { 17 18 var $_title; 19 var $_description; 20 var $_link; 21 var $_channel; 22 23 /** 24 * Constructor. 25 * 26 * @param rssChannel An associative array which is the output of the MagpieRSS library 27 */ 28 function RSSChannel( $rssChannel ) 29 { 30 $this->_title = $rssChannel["title"]; 31 $this->_description = $rssChannel["description"]; 32 $this->_link = $rssChannel["link"]; 33 34 $this->_channel = $rssChannel; 35 } 36 37 /** 38 * Returns the title of the channel 39 * 40 * @return Title of the channel 41 */ 42 function getTitle() 43 { 44 return $this->_title; 45 } 46 47 /** 48 * Returns the description of the channel 49 * 50 * @return Description of the channel 51 */ 52 function getDescription() 53 { 54 return $this->_description; 55 } 56 57 /** 58 * Returns the link of the channel 59 * 60 * @return The link of the channel 61 */ 62 function getLink() 63 { 64 return $this->_link; 65 } 66 67 /** 68 * Gets another property of the channel. The methods shown so far give easier access 69 * to some of the methods more commonly used, but the MagpieRSS will include anything else 70 * in the output array, so access is given to this method. We only need to know the name 71 * of the parameter. 72 * 73 * @param key The name of the parameter 74 * @return The value assigned to that parameter 75 */ 76 function get( $key ) 77 { 78 return $this->_channel[$key]; 79 } 80 } 81 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 21:04:15 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |