Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcFeedModule

Feed::ezcFeedModule

Class ezcFeedModule

Container for feed module data.

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').

Source for this file: /Feed/src/interfaces/module.php

Version:   //autogentag//

Descendants

Child Class Description
ezcFeedDublinCoreModule Support for the DublinCore 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.
ezcFeedGeoModule Support for the Geo module: data container, generator, parser.
ezcFeedGeoRssModule Support for the GeoRss 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 static ezcFeedModule create( $name , [ $level = 'feed'] )
Returns a new instance of the $name module with data container level $level.
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 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

create

static ezcFeedModule create( string $name , [string $level = 'feed'] )

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')

__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:
Method Description
ezcFeedDublinCoreModule::__construct() Constructs a new ezcFeedDublinCoreModule object. 
ezcFeedContentModule::__construct() Constructs a new ezcFeedContentModule object. 
ezcFeedCreativeCommonsModule::__construct() Constructs a new ezcFeedCreativeCommonsModule object. 
ezcFeedGeoModule::__construct() Constructs a new ezcFeedContentModule object. 
ezcFeedGeoRssModule::__construct() Constructs a new ezcFeedContentModule object. 
ezcFeedITunesModule::__construct() Constructs a new ezcFeedITunesModule object. 

add

ezcFeedElement add( string $name )

Adds a new ezcFeedElement element with name $name to this module and returns it.

Parameters:
Name Type Description
$name string The element name
Exceptions:
Type Description
ezcFeedUnsupportedElementException if trying to add an element which is not supported.
Redefined in descendants as:
Method Description
ezcFeedDublinCoreModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 
ezcFeedContentModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 
ezcFeedCreativeCommonsModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 
ezcFeedGeoModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 
ezcFeedGeoRssModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 
ezcFeedITunesModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it. 

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:
Method Description
ezcFeedDublinCoreModule::generate() Adds the module elements to the $xml XML document, in the container $root. 
ezcFeedContentModule::generate() Adds the module elements to the $xml XML document, in the container $root. 
ezcFeedCreativeCommonsModule::generate() Adds the module elements to the $xml XML document, in the container $root. 
ezcFeedGeoModule::generate() Adds the module elements to the $xml XML document, in the container $root. 
ezcFeedGeoRssModule::generate() Adds the module elements to the $xml XML document, in the container $root. 
ezcFeedITunesModule::generate() Adds the module elements to the $xml XML document, in the container $root. 

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:
Method Description
ezcFeedDublinCoreModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 
ezcFeedContentModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 
ezcFeedCreativeCommonsModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 
ezcFeedGeoModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 
ezcFeedGeoRssModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 
ezcFeedITunesModule::isElementAllowed() Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise. 

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:
Method Description
ezcFeedDublinCoreModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
ezcFeedContentModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
ezcFeedCreativeCommonsModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
ezcFeedGeoModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
ezcFeedGeoRssModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
ezcFeedITunesModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name. 
Documentation generated by phpDocumentor 1.4.3