Feed: ezcFeedModule
[ ]
[ Specifications ]
[ ]
[ ]
[ ]
[ ]
Class: ezcFeedModule
|
Container for feed module data. [
source]
Currently implemented by these feed modules:
The child classes must implement these static methods:
- isElementAllowed() - Returns true if an element can be added to the module.
- add() - Adds an element to the module.
- getModuleName() - Returns the module name (eg. 'DublinCore')
- getNamespace() - Returns the namespace for the module
(eg. 'http://purl.org/dc/elements/1.1/').
- getNamespacePrefix() - Returns the namespace prefix for the module (eg. 'dc').
Descendents
| Child Class |
Description |
| ezcFeedDublinCoreModule |
Support for the DublinCore module: data container, generator, parser.
|
| ezcFeedGeoModule |
Support for the Geo module: data container, generator, parser.
|
| ezcFeedContentModule |
Support for the Content module: data container, generator, parser.
|
| ezcFeedCreativeCommonsModule |
Support for the CreativeCommons module: data container, generator, parser.
|
| ezcFeedITunesModule |
Support for the iTunes module: data container, generator, parser.
|
Member Variables
|
protected string |
$level
The level of the module data container. Possible values are 'feed' or 'item'. |
|
protected array(string=>mixed) |
$properties
= array()
Holds the properties of this class. |
Method Summary
|
public ezcFeedModule |
__construct(
[$level = 'feed'] )
Constructs a new ezcFeedModule object. |
|
public abstract ezcFeedElement |
add(
$name )
Adds a new ezcFeedElement element with name $name to this module and returns it. |
|
public static ezcFeedModule |
create(
$name, [$level = 'feed'] )
Returns a new instance of the $name module with data container level $level. |
|
public abstract void |
generate(
$xml, $root )
Adds the module elements to the $xml XML document, in the container $root. |
|
public abstract bool |
isElementAllowed(
$name )
Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. |
|
public abstract void |
parse(
$name, $node )
Parses the XML element $node and creates a feed element in the current module with name $name. |
Methods
__construct
ezcFeedModule __construct(
[string
$level = 'feed'] )
Constructs a new ezcFeedModule object.
Parameters
| Name |
Type |
Description |
$level |
string |
The level of the data container ('feed' or 'item') |
Redefined in descendants as
add
Adds a new ezcFeedElement element with name $name to this module and returns it.
Parameters
| Name |
Type |
Description |
$name |
string |
The element name |
Throws
| Class | Description |
ezcFeedUnsupportedElementException |
if trying to add an element which is not supported. |
Redefined in descendants as
create
Returns a new instance of the $name module with data container level $level.
Parameters
| Name |
Type |
Description |
$name |
string |
The name of the module to create |
$level |
string |
The level of the data container ('feed' or 'item') |
generate
void generate(
$xml,
$root )
Adds the module elements to the $xml XML document, in the container $root.
Parameters
| Name |
Type |
Description |
$xml |
DOMDocument |
The XML document in which to add the module elements |
$root |
DOMNode |
The parent node which will contain the module elements |
Redefined in descendants as
isElementAllowed
bool isElementAllowed(
string
$name )
Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise.
Parameters
| Name |
Type |
Description |
$name |
string |
The element name to check if allowed in the current module and level (feed or item) |
Redefined in descendants as
parse
void parse(
string
$name,
$node )
Parses the XML element $node and creates a feed element in the current module with name $name.
Parameters
| Name |
Type |
Description |
$name |
string |
The name of the element belonging to the module |
$node |
DOMElement |
The XML child from which to take the values for $name |
Redefined in descendants as
Last updated: Wed, 18 Jun 2008