Class Golem_Api_Article_Images

Description

Implements interfaces:

  • Iterator (internal interface)
  • Countable (internal interface)

Class for accessing the images associated with an article via web interface.

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


	
			
Class Constant Summary
 URL = 'http://api.golem.de/api/article/images/'
Variable Summary
Integer $idArticle
String $key
Array $result
Method Summary
Golem_Api_Article_Images __construct (String $key, Integer $id)
int count ()
Array current ()
Boolean fetch ([Array $curlOptions = array()])
Array getImages ()
int key ()
void next ()
void rewind ()
void valid ()
Variables
Integer $idArticle = null (line 75)

Article identifier

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

Developer access key

  • access: protected
Array $result = array() (line 69)

Holds the image list data

  • access: protected
Methods
Constructor __construct (line 92)

Creates a Article_Images object

  • access: public
Golem_Api_Article_Images __construct (String $key, Integer $id)
  • String $key: the developer key
  • Integer $id: the article identifier
count (line 140)

Returns the number of images in an article.

  • return: the number of images
  • access: public
int count ()

Implementation of:
Countable::count
current (line 226)

Returns the current image entry.

An entry contains:

  • imageid - {Integer} - The image identifier. The identifier should be not expected to be unique!
  • subtext - {String} - A text associated with the image.
  • small - {Array} - The data for the image as thumbnail. The typical size of an thumbnail is 120x90 pixel.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • medium - {Array} - The data for the image in a medium size. The maximum width of a medium size image is 480 pixel. The height may differ.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • native - {Array} - The data for the image. The size of the image is not limited, but a size of 1024x786 is exceeded in rare situations only.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel

  • access: public
Array current ()

Implementation of:
Iterator::current
fetch (line 116)

Does the request to get the list of images of an article.

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_Meta::ERROR_INVALID_IDENITIFER

After a successful request the image data is available via the getImages method.

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

Returns the list of images.

Each entry in the array holds the data for an image:

  • imageid - {Integer} - The image identifier. The identifier should be not expected to be unique!
  • subtext - {String} - A text associated with the image.
  • small - {Array} - The data for the image as thumbnail. The typical size of an thumbnail is 120x90 pixel.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • medium - {Array} - The data for the image in a medium size. The maximum width of a medium size image is 480 pixel. The height may differ.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel
  • native - {Array} - The data for the image. The size of the image is not limited, but a size of 1024x786 is exceeded in rare situations only.
    • url - {String} - The image url
    • width - {Integer} - The image width in pixel
    • height - {Integer} - The image height in pixel

  • return: the list of images
  • access: public
Array getImages ()
key (line 237)

Returns the current key

  • access: public
int key ()

Implementation of:
Iterator::key
next (line 247)

Moves the internal counter to the next entry

in the image list

  • access: public
void next ()

Implementation of:
Iterator::next
rewind (line 187)

Sets the internal counter to 0

  • access: public
void rewind ()

Implementation of:
Iterator::rewind
valid (line 256)

Checks if the current counter refers to an existing entry

  • access: public
void valid ()

Implementation of:
Iterator::valid
Class Constants
ERROR_INVALID_IDENTIFIER = 10 (line 63)

Error code for an invalid article identifier

URL = 'http://api.golem.de/api/article/images/' (line 58)

Base url of the webservice

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