MagpieFromSimplePie::__construct PHP Method

__construct() public method

MagpieFromSimplePie constructor
public __construct ( SimplePie $pie, mixed $item = true )
$pie SimplePie The feed to convert to MagpieRSS format.
$item mixed
    function __construct($pie, $item = true)
    {
        $this->pie = $pie;
        // item in {NULL, true} = process channel data
        if (!is_a($item, 'SimplePie_Item')) {
            $this->originals = $this->pie->get_items();
            $this->channel = $this->processFeedData($this->pie->data);
        } else {
            $this->originals = array($item);
            $this->channel = NULL;
        }
        // item in {true, SimplePie_Item} = process item data
        if (!is_null($item)) {
            foreach ($this->originals as $key => $item) {
                $this->items[$key] = $this->processItemData($item->data);
            }
        } else {
            $this->items = NULL;
        }
        $this->normalize();
        // In case anyone goes poking around our private members (uh...)
        $this->feed_type = $this->is_atom() ? 'Atom' : 'RSS';
        $this->feed_version = $this->feed_version();
        $this->encoding = $pie->get_encoding();
    }