Path

ez components / documentation / api reference / 2009.2.1 / feed


eZ Components 2009.2.1

Feed: ezcFeedModule

[ Tutorial ] [ Specifications ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

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
ezcFeedITunesModule Support for the iTunes module: data container, generator, parser.
ezcFeedDublinCoreModule Support for the DublinCore module: data container, generator, parser.
ezcFeedContentModule Support for the Content module: data container, generator, parser.
ezcFeedGeoModule Support for the Geo module: data container, generator, parser.
ezcFeedCreativeCommonsModule Support for the CreativeCommons 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

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

Throws

ClassDescription
ezcFeedUnsupportedElementException if trying to add an element which is not supported.

Redefined in descendants as

Method Description
ezcFeedITunesModule::add() Adds a new ezcFeedElement element with name $name to this module and returns it.
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.
ezcFeedGeoModule::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.

create

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

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

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

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
ezcFeedITunesModule::parse() Parses the XML element $node and creates a feed element in the current module with name $name.
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.
ezcFeedGeoModule::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.

Last updated: Tue, 23 Mar 2010