PHP Class Pop\Feed\Writer

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$data array Feed data for JSON and PHP formats
$dateFormat string Feed date format
$feedType string Feed type
$headers array Feed headers
$items array Feed items

Public Methods

Method Description
__construct ( array $headers, array $items, mixed $type = Writer::RSS, string $date = 'D, j M Y H:i:s O' ) : Writer Constructor
factory ( array $headers, array $items, mixed $type = Writer::RSS, string $date = 'D, j M Y H:i:s O' ) : Writer Static method to instantiate the feed writer object and return itself to facilitate chaining methods together.
render ( boolean $ret = false ) : mixed Method to render the feed and its items

Protected Methods

Method Description
init ( ) : void Initialize the feed.

Method Details

__construct() public method

Instantiate the feed object.
public __construct ( array $headers, array $items, mixed $type = Writer::RSS, string $date = 'D, j M Y H:i:s O' ) : Writer
$headers array
$items array
$type mixed
$date string
return Writer

factory() public static method

Static method to instantiate the feed writer object and return itself to facilitate chaining methods together.
public static factory ( array $headers, array $items, mixed $type = Writer::RSS, string $date = 'D, j M Y H:i:s O' ) : Writer
$headers array
$items array
$type mixed
$date string
return Writer

init() protected method

Initialize the feed.
protected init ( ) : void
return void

render() public method

Method to render the feed and its items
public render ( boolean $ret = false ) : mixed
$ret boolean
return mixed

Property Details

$data protected property

Feed data for JSON and PHP formats
protected array $data
return array

$dateFormat protected property

Feed date format
protected string $dateFormat
return string

$feedType protected property

Feed type
protected string $feedType
return string

$headers protected property

Feed headers
protected array $headers
return array

$items protected property

Feed items
protected array $items
return array