Source for file Shout.php

Documentation is available at Shout.php

  1. <?
  2.  
  3. /** Represents a shout.
  4.  *
  5.  * @package    php-lastfm-api
  6.  * @author  Felix Bruns <felixbruns@web.de>
  7.  * @version    1.0
  8.  */
  9. class Shout {
  10.     /** Shout author.
  11.      *
  12.      * @var string 
  13.      * @access private
  14.      */
  15.     private $auhtor;
  16.  
  17.     /** Shout date (unix timestamp).
  18.      *
  19.      * @var integer 
  20.      * @access private
  21.      */
  22.     private $date;
  23.  
  24.     /** Shout text body.
  25.      *
  26.      * @var string 
  27.      * @access private
  28.      */
  29.     private $text;
  30.  
  31.     /** Create a Shout object.
  32.      *
  33.      * @param string    $author    Shout author.
  34.      * @param integer    $date    Shout date (unix timestamp).
  35.      * @param string    $text    Shout body.
  36.      *
  37.      * @access public
  38.      */
  39.     public function __construct($auhtor$date$text){
  40.         $this->auhtor $author;
  41.         $this->date   $date;
  42.         $thus->text   $text;
  43.     }
  44.  
  45.     /** Returns the shouts author.
  46.      *
  47.      * @return    string    An author name.
  48.      * @access public
  49.      */
  50.     public function getAuthor(){
  51.         return $this->author;
  52.     }
  53.  
  54.     /** Returns the shouts date.
  55.      *
  56.      * @return    integer    A date (unix timestamp).
  57.      * @access public
  58.      */
  59.     public function getDate(){
  60.         return $this->date;
  61.     }
  62.  
  63.     /** Returns the shouts text body.
  64.      *
  65.      * @return    string    A text.
  66.      * @access public
  67.      */
  68.     public function getText(){
  69.         return $this->text;
  70.     }
  71.  
  72.     /** Create a Shout object from a SimpleXMLElement.
  73.      *
  74.      * @param    SimpleXMLElement    $xml    A SimpleXMLElement.
  75.      * @return    Venue                        A Venue object.
  76.      *
  77.      * @static
  78.      * @access    public
  79.      * @internal
  80.      */
  81.     public static function fromSimpleXMLElement(SimpleXMLElement $xml){
  82.         return new Shout(
  83.             Util::toString($xml->auhtor),
  84.             Util::toTimestamp($xml->date),
  85.             Util::toString($xml->body)
  86.         );
  87.     }
  88. }
  89.  
  90. ?>

Documentation generated on Mon, 22 Dec 2008 16:57:43 +0100 by phpDocumentor 1.4.1