本文整理汇总了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());
}
}
}
示例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());
}
示例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;
}
示例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');
}