phpDocumentor Swift
[ class tree: Swift ] [ index: Swift ] [ all elements ]

Class: SwiftRss

Source Location: /classes/SwiftRss.php

Class SwiftRss

Class Overview

This class contains functions to create a dynamic RSS feed on the fly.

Located in /classes/SwiftRss.php [line 42]



		
		
		
		

Methods

[ Top ]
Method Summary
SwiftRss   __construct()   Create and load a new SwiftRss object. If a filename to a well-formed RSS feed is provided then it will be loaded into new object. Otherwise, if filename is null then an empty feed will be loaded which elements may added to.
void   addItem()   Add a new item to the RSS feed.
array   getChannel()   Get the current channel object from the feed.
integer   getCount()   Get the number of items from the feed
array   getItems()   Get the current channel itmes from the feed.
string   getRss()   Get the RSS feed as XML
void   load()   Load an existing well formated XML RSS feed into our object, or load an empty skeleton feed for us to add elements to.
void   setChannel()   Set the channel data for the current RSS feed loaded or created in this Rss object.
string   writeRss()   Write the current RSS feed to a XML file.

[ Top ]
Methods
Constructor __construct  [line 56]

  SwiftRss __construct( [string $filename = null]  )

Create and load a new SwiftRss object. If a filename to a well-formed RSS feed is provided then it will be loaded into new object. Otherwise, if filename is null then an empty feed will be loaded which elements may added to.

Parameters:
string   $filename:  The filename or URI to the XML RSS feed.

API Tags:
Return:  The new SwiftRss object
Access:  public


[ Top ]
addItem  [line 145]

  void addItem( string $title, string $link, string $desc, [string $pubDate = null], [string $comments = null], [string $author = null], [string $category = null]  )

Add a new item to the RSS feed.

Parameters:
string   $title:  Title of the channel
string   $link:  URL of the channel
string   $desc:  Short description of the feed
string   $pubDate:  Date of publication (current date of null)
string   $comments:  URL to comments or comments feed (optional)
string   $author:  Name of the author (optional)
string   $category:  Name of category (optional)

API Tags:
Access:  public


[ Top ]
getChannel  [line 115]

  array getChannel( )

Get the current channel object from the feed.


API Tags:
Return:  Channel array
Access:  public


[ Top ]
getCount  [line 131]

  integer getCount( )

Get the number of items from the feed


API Tags:
Return:  Number of items
Access:  public


[ Top ]
getItems  [line 123]

  array getItems( )

Get the current channel itmes from the feed.


API Tags:
Return:  Array of channel data
Access:  public


[ Top ]
getRss  [line 168]

  string getRss( )

Get the RSS feed as XML


API Tags:
Return:  XML output for this RSS feed.
Access:  public


[ Top ]
load  [line 65]

  void load( [string $filename = null]  )

Load an existing well formated XML RSS feed into our object, or load an empty skeleton feed for us to add elements to.

Parameters:
string   $filename:  The filename or URI to the XML RSS feed.

API Tags:
Access:  public


[ Top ]
setChannel  [line 84]

  void setChannel( string $title, string $link, string $desc, [string $lang = "en-us"], [string $lastBuild = null], [string $generator = null]  )

Set the channel data for the current RSS feed loaded or created in this Rss object.

Parameters:
string   $title:  Title of the channel
string   $link:  URL of the channel
string   $desc:  Short description of the feed
string   $lang:  Language-code of the feed (e.g. en-us)
string   $lastBuild:  Date of last-build of RSS feed.
string   $generator:  Name to use in generator tag of RSS feed.

API Tags:
Access:  public


[ Top ]
writeRss  [line 177]

  string writeRss( string $filename  )

Write the current RSS feed to a XML file.

Parameters:
string   $filename:  Filename to write to.

API Tags:
Return:  XML output for this RSS feed.
Access:  public


[ Top ]

Documentation generated on Tue, 08 Oct 2013 05:37:16 +0200 by phpDocumentor 1.4.4