Support for the Content module: data container, generator, parser.
Specifications: http://purl.org/rss/1.0/modules/content/. Only support for the 'encoded' element of the Content module is provided.
Create example:
Parse example:
Source for this file: /Feed/src/modules/content_module.php
ezcFeedModule | --ezcFeedContentModule
Version: | //autogentag// |
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. |
From ezcFeedModule | |
---|---|
protected |
ezcFeedModule::$level
|
protected |
ezcFeedModule::$properties
|
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 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 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. |
From ezcFeedModule | |
---|---|
public ezcFeedModule |
ezcFeedModule::__construct()
Constructs a new ezcFeedModule object. |
public abstract ezcFeedElement |
ezcFeedModule::add()
Adds a new ezcFeedElement element with name $name to this module and returns it. |
public static ezcFeedModule |
ezcFeedModule::create()
Returns a new instance of the $name module with data container level $level. |
public abstract void |
ezcFeedModule::generate()
Adds the module elements to the $xml XML document, in the container $root. |
public abstract bool |
ezcFeedModule::isElementAllowed()
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 |
ezcFeedModule::parse()
Parses the XML element $node and creates a feed element in the current module with name $name. |
Returns the module name ('Content').
Returns the namespace for this module ('http://purl.org/rss/1.0/modules/content/').
Returns the namespace prefix for this module ('content').
Constructs a new ezcFeedContentModule object.
Name | Type | Description |
---|---|---|
$level |
string | The level of the data container ('feed' or 'item') |
Method | Description |
---|---|
ezcFeedModule::__construct() |
Constructs a new ezcFeedModule object. |
Adds a new ezcFeedElement element with name $name to this module and returns it.
Name | Type | Description |
---|---|---|
$name |
string | The element name |
Type | Description |
---|---|
ezcFeedUnsupportedElementException |
if trying to add an element which is not supported. |
Method | Description |
---|---|
ezcFeedModule::add() |
Adds a new ezcFeedElement element with name $name to this module and returns it. |
Adds the module elements to the $xml XML document, in the container $root.
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 |
Method | Description |
---|---|
ezcFeedModule::generate() |
Adds the module elements to the $xml XML document, in the container $root. |
Returns true if the element $name is allowed in the current module at the current level (feed or item), and false otherwise.
Name | Type | Description |
---|---|---|
$name |
string | The element name to check if allowed in the current module and level (feed or item) |
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. |
Parses the XML element $node and creates a feed element in the current module with name $name.
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 |
Method | Description |
---|---|
ezcFeedModule::parse() |
Parses the XML element $node and creates a feed element in the current module with name $name. |