Home » Docs » FeedConstruct

FeedConstruct

The FeedConstruct class contains the information required to control the output of feed data in various formats.  The class contains methods that are used internally to construct a representation of each feed schema that is used to validate feed components and control output.  The feed format is specified as an input parameter when instantiating the class, which allows the class to then build a hierarchical representation of the specified schema.

 

Feed Constructs:

Each element in a feed schema is represented by a single construct added to the construct array of the class.  This includes information that links the element/construct with it’s parent allowing a logical structure to be generated using the class.  Other information stored in a feed construct are the minimum and maximum number of times that the element can be included in the feed, character limits (where applicable), the output data type, attributes to be included in the XML element and more.

 

commonName Values

The logical representation is built using a set of “constructs” for each feed output format.  Each construct added to the FeedConstruct class has a “commonName” value that maps the construct to corresponding data in the feed.  This value should match the key of an element in the feed data or item data arrays, and is used to obtain the corresponding data from the feed during validation and output.

A full list and details of the constructs and “commonName” values and the “Predefined Feed Construct” for each format supported by Php FeedWriter are also provided on the pages.

 

Feed Construct Modifications:

The functionality provided by the FeedConstruct class can be utilised to modify or build a new construct at run-time / “on the fly”, which gives you greater control over the output of a feed in multiple formats.  A common example would be to update the data type for a text element in the feed from “text” to “html”.  This will allow HTML to be included and parsed/rendered in a feed item when displayed in a reader or web browser.  For a full list of the data types supported by Php FeedWriter including a description of each and example output, see Output Data Types.

 

 

Class Functions and Usage


Comments (0)

No comments yet

Leave a Reply

You must be logged in to post a comment.
  • Php FeedWriter (c) Copyright 2011 Daniel Soutter. Php FeedWriter and the information on this site has been designed to benefit website developers, owners and users, but may contain errors and is provided as is, with no warranty. Terms.