Class Golem_Api_Theme_Article


Class for accessing the latest articles of a theme category via web interface.

Located in /Api/Theme/Article.php (line 52)

Class Constant Summary
 URL = ''
Variable Summary
Array $articles
String $key
Integer $maxArticles
String $theme
Method Summary
Golem_Api_Theme_Article __construct (String $key, String $theme, [Integer $maxArticles = 10])
Boolean fetch ([Array $curlOptions = array()])
Array getArticles ()
Array $articles = array() (line 86)

Top article data

  • access: protected
String $key = null (line 92)

Developer access key

  • access: protected
Integer $maxArticles = 10 (line 80)

Amount of top articles to fetch

  • access: protected
String $theme = null (line 74)

Short Name of the theme category to use

  • access: protected
Constructor __construct (line 101)

Creates the Theme_Article object

  • access: public
Golem_Api_Theme_Article __construct (String $key, String $theme, [Integer $maxArticles = 10])
  • String $key: your developer key
  • String $theme: the shortname of the theme category to use
  • Integer $maxArticles: the number of articles to fetch
fetch (line 126)

Does the request to get the list of latest articles of a theme category.

If the request was succesful, true will be returned, else an exception will be thrown.

The possible Exception codes are Golem_Request::DATABASE and Golem_Api_Article_Latest::ERROR_LIMIT.

After a successful request the article list is available from getArticles().

  • return: true, if request was successful
  • access: public
Boolean fetch ([Array $curlOptions = array()])
  • Array $curlOptions: optional options for cUrl
getArticles (line 159)

Returns the list of articles.

In the array, each entry represents a article record. The keys of record array are:

  • articleid - Integer - Article identifier
  • headline - String - Headline
  • abstracttext - String - article abstract
  • url - String - article URL
  • date - Integer - article publishing as unix timestamp

  • access: public
Array getArticles ()
Class Constants
ERROR_LIMIT = 102 (line 63)

Error code for an invalid limit value

ERROR_NO_THEME = 103 (line 68)

Error code for not theme category name not provided

URL = '' (line 58)

Base url of the webservice

Documentation generated on Tue, 20 Apr 2010 14:21:06 +0200 by phpDocumentor 1.4.3