当前位置: 首页>>代码示例>>PHP>>正文


PHP Feed::setTitle方法代码示例

本文整理汇总了PHP中Feed::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::setTitle方法的具体用法?PHP Feed::setTitle怎么用?PHP Feed::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Feed的用法示例。


在下文中一共展示了Feed::setTitle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeEdit

 public function executeEdit($request, $new = false)
 {
     $this->form = new PodcastForm($new ? null : PodcastPeer::retrieveByPk($request->getParameter('id')));
     $this->podcast = $this->form->getObject();
     $this->episodes = $this->podcast->getEpisodes();
     $this->feeds = $this->podcast->getFeeds();
     $this->podcast_feed_form = new FeedForm();
     $this->podcast_feed_form->setDefaults(array('podcast_id' => $this->podcast->getId()), array());
     if ($request->isMethod('post')) {
         $this->form->bind($request->getPostParameters(), array());
         // FIXME bind to real files array
         if ($this->form->isValid()) {
             $podcast = $this->form->save();
             if ($new) {
                 $feed = new Feed();
                 // add a sensible default feed
                 $feed->setTitle('default');
                 $feed->setSlug('default');
                 $podcast->addFeed($feed);
                 $feed->save();
                 $podcast->setDefaultFeed($feed);
                 $podcast->save();
             }
             $this->redirect('podcast/edit?id=' . $podcast->getId());
         }
     }
 }
开发者ID:WIZARDISHUNGRY,项目名称:sflimetracker,代码行数:27,代码来源:actions.class.php

示例2: testToAPI

 public function testToAPI()
 {
     $feed = new Feed();
     $feed->setId(3);
     $feed->setUrl('http://google');
     $feed->setTitle('title');
     $feed->setFaviconLink('favicon');
     $feed->setAdded(123);
     $feed->setFolderId(1);
     $feed->setUnreadCount(321);
     $feed->setLink('https://google');
     $this->assertEquals(array('id' => 3, 'url' => 'http://google', 'title' => 'title', 'faviconLink' => 'favicon', 'added' => 123, 'folderId' => 1, 'unreadCount' => 321, 'link' => 'https://google'), $feed->toAPI());
 }
开发者ID:hroo772,项目名称:news,代码行数:13,代码来源:FeedTest.php

示例3: createFeed

 private function createFeed()
 {
     $feed = new Feed();
     $feed->setId(3);
     $feed->setLastModified(44);
     $feed->setEtag(45);
     $feed->setUrl('http://google.com/some/weird/path');
     $feed->setTitle('title');
     $feed->setFaviconLink('favicon');
     $feed->setAdded(123);
     $feed->setFolderId(1);
     $feed->setUnreadCount(321);
     $feed->setLink('https://www.google.com/some/weird/path');
     $feed->setLocation('http://google.at');
     $feed->setOrdering(2);
     return $feed;
 }
开发者ID:sbambach,项目名称:news,代码行数:17,代码来源:FeedTest.php

示例4: x_attribute

$z->open('xml/' . $source);
$feeds = array();
$doc = new DOMDocument();
require_once 'models/feed.php';
function x_attribute($object, $attribute)
{
    if (isset($object[$attribute])) {
        return (string) $object[$attribute];
    }
}
while ($z->read() && $z->name !== 'source') {
}
while ($z->name === 'source') {
    $node = new SimpleXMLElement($z->readOuterXML());
    $feed = new Feed();
    $feed->setTitle($node->title);
    $feed->setURL($node->feed_url);
    $feed->setPicture($node->picture);
    $feeds[] = $feed;
    if (!file_exists('xml/feeds/' . $feed->title . '.xml')) {
        file_put_contents('xml/feeds/' . $feed->title . ".xml", file_get_contents($feed->feed_url));
    } else {
        $ttl = 1800;
        $age = time() - filemtime('xml/feeds/' . $feed->title . '.xml');
        if ($age >= $ttl) {
            unlink('xml/feeds/' . $feed->title . '.xml');
            file_put_contents('xml/feeds/' . $feed->title . ".xml", file_get_contents($feed->feed_url));
        }
    }
    $z->next('source');
}
开发者ID:rhutton,项目名称:Moodle-LiveTile,代码行数:31,代码来源:getimportantsources.php


注:本文中的Feed::setTitle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。