SyndicatedPost::source PHP Méthode

source() public méthode

* SyndicatedPost::enclosures()
public source ( $what = NULL )
    function source($what = NULL)
    {
        $ret = NULL;
        $source = $this->entry->get_source();
        if ($source) {
            $ret = array();
            $ret['title'] = $source->get_title();
            $ret['uri'] = $source->get_link();
            $ret['feed'] = $source->get_link(0, 'self');
            if ($id_tags = $source->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'id')) {
                $ret['id'] = $id_tags[0]['data'];
            } elseif ($id_tags = $source->get_source_tags(SIMPLEPIE_NAMESPACE_ATOM_03, 'id')) {
                $ret['id'] = $id_tags[0]['data'];
            } elseif ($id_tags = $source->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'guid')) {
                $ret['id'] = $id_tags[0]['data'];
            } elseif ($id_tags = $source->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_10, 'guid')) {
                $ret['id'] = $id_tags[0]['data'];
            } elseif ($id_tags = $source->get_source_tags(SIMPLEPIE_NAMESPACE_RSS_090, 'guid')) {
                $ret['id'] = $id_tags[0]['data'];
            }
        }
        if (!is_null($what) and is_scalar($what)) {
            $ret = $ret[$what];
        }
        return $ret;
    }