本文整理汇总了PHP中Tag::fetchAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Tag::fetchAll方法的具体用法?PHP Tag::fetchAll怎么用?PHP Tag::fetchAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag::fetchAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findTags
public function findTags($id)
{
Zend_Registry::get('logger')->entering();
$tags = new Tag();
$subquery = $this->_db->select();
$subquery->from('tags_items', 'tag_id');
$subquery->where('item_id = ?', $id);
return $tags->fetchAll('id IN (' . $subquery . ')');
Zend_Registry::get('logger')->exiting();
}
示例2: admineditAction
function admineditAction()
{
$reportTab = new ReportTab();
$this->view->reportTab = $reportTab->fetchRow("id = " . $this->getRequest()->getParam('id'));
$campaign = new Campaign();
$this->view->campaigns = $campaign->fetchAll();
$tag = new Tag();
$this->view->tags = $tag->fetchAll();
$tagging = new Tagging();
//$taggings = $tagging->fetchAll($tagging->select()->from('taggings', 'tag_id')->where('report_tab_id = ? ', $this->getRequest()->getParam('id')));
$taggings = $tagging->findBy(array('report_tab_id' => $this->getRequest()->getParam('id')));
$tagging_ids = array();
foreach ($taggings as $tagging) {
array_push($tagging_ids, $tagging->tag_id);
}
$this->view->taggings = $tagging_ids;
}
示例3: tagAction
public function tagAction()
{
$this->_helper->viewRenderer->setNeverRender();
$this->view->layout()->disableLayout();
$get = Zend_Registry::get('getFilter');
$search = $get->q;
$tag = new Tag();
$tags = $tag->fetchAll();
//echo $search;
if ($search != '') {
foreach ($tags as $t) {
if (strpos(strtolower($t->name), $search) !== false) {
echo $t->name . "|" . $t->tagId . "\n";
}
}
}
}
示例4: init
public function init()
{
// doctype
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
$viewRenderer->view->doctype('XHTML1_STRICT');
// js + css
$this->view->headScript()->prependFile('/js/swfobject/swfobject.js');
$this->view->headLink()->prependStylesheet('/css/base.css?' . date('Ymd'));
// tags
$tagManager = new Tag();
$this->view->tags = $tagManager->fetchAll(null, "(SELECT COUNT(*) FROM posts_tags WHERE tag_id = tags.id) DESC");
// description
if ($this->view->metaDescription === NULL) {
$this->view->metaDescription = 'Hi, my name is Neil Garb and I\'m a web developer.';
}
// keywords
if ($this->view->metaKeywords === NULL) {
$this->view->metaKeywords = array('codecaine', 'codecaine.co.za', 'neil garb', 'php', 'php blog', 'web developer', 'web development', 'blog', 'cape town', 'south africa');
}
}
示例5: indexAction
public function indexAction()
{
$this->logger->entering();
$this->logger->info('Load all tags');
$tagTable = new Tag();
$tagSet = $tagTable->fetchAll();
$this->logger->info('Load item count for each tag');
$tags = array();
foreach ($tagSet as $tag) {
$tag = $tag->toArray();
$tag['count'] = $tagTable->findItems($tag['id'])->count();
$tags[] = $tag;
}
$this->logger->debug("Got '" . count($tags) . "' tags");
$this->logger->info('Load view parameters');
$this->view->assign(array('title' => 'Keywords', 'tags' => $tags));
$this->logger->info('Render view');
$this->render();
$this->logger->exiting();
}
示例6: sitemapAction
public function sitemapAction()
{
header('Content-Type: application/xhtml+xml');
$urls = array('/' => mktime(0, 0, 0, date('m'), date('d'), date('Y')), '/about' => mktime(0, 0, 0, date('m'), date('d'), date('Y')));
$postManager = new Post();
$posts = $postManager->fetchAll(array('is_active = ?' => 1), 'posted_at DESC');
foreach ($posts as $post) {
$urls['/posts/' . $post->label] = strtotime($post->posted_at);
}
$tagManager = new Tag();
$tags = $tagManager->fetchAll(null, 'title');
foreach ($tags as $tag) {
$urls['/tags/' . $tag->label] = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
}
echo '<' . '?xml version="1.0"?' . '>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
foreach ($urls as $u => $t) {
echo "\t" . '<url>' . "\n" . "\t\t" . '<loc>http://codecaine.co.za' . $u . '</loc>' . "\n" . "\t\t" . '<lastMod>' . date('Y-m-d', $t) . 'T' . date('H:i:s', $t) . '+2:00</lastMod>' . "\n" . "\t" . '</url>' . "\n";
}
echo '</urlset>';
die;
}