Feed: ezcFeedContentModule
[ ]
[ Specifications ]
[ ]
[ ]
[ ]
[ ]
Class: ezcFeedContentModule
|
Support for the Content module: data container, generator, parser. [
source]
Create example:
1. <?php
2. // $feed is an ezcFeed object
3. $item = $feed->add( 'item' );
4. $module = $item->addModule( 'Content' );
5. $module->encoded = 'text content';
6. ?>
Parse example:
1. <?php
2. // $item is an ezcFeedEntryElement object
3. $text = $item->Content->encoded;
4. ?>
Parents
ezcFeedModule
|
--ezcFeedContentModule
Properties
|
ezcFeedTextElement |
read/write
|
$encoded
Item-level container for text. The text is stored in a feed by applying htmlspecialchars() with ENT_NOQUOTES and restored from a feed with htmlspecialchars_decode() with ENT_NOQUOTES. |
Inherited Member Variables
From
ezcFeedModule:
Method Summary
|
public ezcFeedContentModule |
__construct(
[$level = 'feed'] )
Constructs a new ezcFeedContentModule object. |
|
public ezcFeedElement |
add(
$name )
Adds a new ezcFeedElement element with name $name to this module and returns it. |
|
public void |
generate(
$xml, $root )
Adds the module elements to the $xml XML document, in the container $root. |
|
public static string |
getModuleName(
)
Returns the module name ('Content'). |
|
public static string |
getNamespace(
)
Returns the namespace for this module ('http://purl.org/rss/1.0/modules/content/'). |
|
public static string |
getNamespacePrefix(
)
Returns the namespace prefix for this module ('content'). |
|
public 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 void |
parse(
$name, $node )
Parses the XML element $node and creates a feed element in the current module with name $name. |
Inherited Methods
From
ezcFeedModule :
Methods
__construct
ezcFeedContentModule __construct(
[string
$level = 'feed'] )
Constructs a new ezcFeedContentModule object.
Parameters
| Name |
Type |
Description |
$level |
string |
The level of the data container ('feed' or 'item') |
Redefinition of
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. |
Redefinition of
| Method |
Description |
ezcFeedModule::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 |
Redefinition of
getModuleName
string getModuleName(
)
Returns the module name ('Content').
getNamespace
string getNamespace(
)
Returns the namespace for this module ('http://purl.org/rss/1.0/modules/content/').
getNamespacePrefix
string getNamespacePrefix(
)
Returns the namespace prefix for this module ('content').
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) |
Redefinition of
| Method |
Description |
ezcFeedModule::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 |
Redefinition of
| Method |
Description |
ezcFeedModule::parse() |
Parses the XML element $node and creates a feed element in the current module with name $name. |
Last updated: Mon, 05 Jan 2009