• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP TagPeer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateTagRelationCache

 public static function updateTagRelationCache($manualLock = false)
 {
     if (!$manualLock) {
         self::checkTagRelationCache('lock');
     }
     try {
         $tagRelationsFile = sfConfig::get('sf_root_dir') . "/cache/objcache/tagsRelations.php";
         $c = new Criteria();
         $allTags = TagPeer::doSelect($c);
         $content = "<?php \n";
         foreach ($allTags as $singleTag) {
             $c = new Criteria();
             $c->add(TagrelationPeer::TAG_ID, $singleTag->getId());
             $tagRelations = TagrelationPeer::doSelect($c);
             if ($tagRelations) {
                 $elementsArr = "array(";
                 foreach ($tagRelations as $tagRelation) {
                     $elementsArr .= $tagRelation->getId() . ",";
                 }
                 $content .= "\$_TagRel['" . $singleTag->getTagId() . "'] = " . substr($elementsArr, 0, -1) . ");\n";
             }
         }
         $content .= "\n?>";
         if (FileHelper::writeFile($tagRelationsFile, $content)) {
             BackendService::loadTagsRelations();
         } else {
             echo FileHelper::Log("Unable to write tag cache in: " . $tagRelationsFile, UtilsHelper::MSG_ERROR);
         }
     } catch (Exception $e) {
         echo FileHelper::Log("Unable to refresh tag cache: " . $e->getMessage(), UtilsHelper::MSG_ERROR);
     }
     if (!$manualLock) {
         self::checkTagRelationCache('unlock');
     }
 }
开发者ID:kotow,项目名称:work,代码行数:35,代码来源:Tagrelation.php


示例2: recordTags

 public static function recordTags($phrase, $model, $obj)
 {
     $tags = TagTools::splitPhrase($phrase);
     foreach ($tags as $settag) {
         $tag = new Tag();
         if ($model == "etime") {
             $modelTag = new EtimeTag();
         } else {
             $modelTag = new EventTag();
         }
         $tag->setTag($settag);
         $c = new Criteria();
         $c->add(TagPeer::NORMALIZED_TAG, $tag->getNormalizedTag());
         $tag_exists = TagPeer::doSelectOne($c);
         if (!$tag_exists) {
             $tag->save();
         } else {
             $tag = $tag_exists;
         }
         if ($model == "etime") {
             $modelTag->setEtime($obj);
         } else {
             $modelTag->setEvent($obj);
         }
         $modelTag->setTag($tag);
         $modelTag->save();
     }
     return true;
 }
开发者ID:soon0009,项目名称:EMS,代码行数:29,代码来源:TagTools.class.php


示例3: parseItem

function parseItem($blog, $item, $ts)
{
    if ($ts != 0 && $item->pubdate <= $ts) {
        logmsg('Zatrzymanie na wpisie: %s', StringUtils::removeAccents($item->title));
        return false;
    }
    logmsg('  - Parsowanie wpisu: %s', StringUtils::removeAccents($item->title));
    $post = new Post();
    $post->setBlog($blog);
    foreach ($item->tags as $name) {
        $tag = TagPeer::retriveByName($name, true);
        if ($post->addTag($tag)) {
            logmsg('    - Znaleziono tag: %s', $name);
        }
    }
    if ($post->hasTags()) {
        $shortened = $post->setFullContent($item->content);
        $post->setLink(htmlspecialchars($item->link));
        $post->setTitle($item->title);
        $post->setCreatedAt($item->pubdate);
        $post->setShortened($shortened);
        $post->save();
    } else {
        logmsg('    - Nie znaleziono tagow');
    }
    return true;
}
开发者ID:noose,项目名称:Planeta,代码行数:27,代码来源:refresh.php


示例4: run_a0_get_main_acts_for_tags

/**
 * estrae gli N atti più rilevanti per determinati argomenti (tag)
 */
function run_a0_get_main_acts_for_tags($task, $args, $options)
{
    static $loaded;
    // load application context
    if (!$loaded) {
        task_loader();
        $loaded = true;
    }
    echo "memory usage: " . memory_get_usage() . "\n";
    $msg = sprintf("start time: %s\n", date('H:i:s'));
    echo $msg;
    $n = 1;
    if (array_key_exists('nrecs', $options)) {
        $n = (int) $options['nrecs'];
    }
    if (!is_int($n) || $n < 1) {
        throw new Exception("il numero di atti deve essere un intero\n");
    }
    if (count($args) > 0) {
        $argomenti = array();
        foreach ($args as $cnt => $arg) {
            $id = TagPeer::getIdFromTagValue($arg);
            $xml_url = sprintf("http://parlamento.openpolis.it/xml/indici/tag/%d.xml", $id);
            $xsl_file = SF_ROOT_DIR . "/web/xml/indici/xslt/tagActsSorter.xslt";
            printf("Argomento %s:\n", $arg, $id);
            getImportantActs($xml_url, $xsl_file, $n);
            print "\n";
        }
    }
    $start_time = time();
    $msg = sprintf("end time: %s\n", date('H:i:s'));
    echo $msg;
    $msg = sprintf("memory usage: %10d\n", memory_get_usage());
    echo pakeColor::colorize($msg, array('fg' => 'red', 'bold' => false));
}
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:38,代码来源:anno0Tasks.php


示例5: getConsolidatedKeywords

 public function getConsolidatedKeywords($sLanguageId = null, $bReturnArray = false)
 {
     if ($sLanguageId == null) {
         $sLanguageId = Session::language();
     }
     $aKeywords = array();
     $aKeywords[] = TranslationPeer::getString('meta.keywords', null, '');
     $aTags = TagPeer::tagInstancesForObject($this);
     foreach ($aTags as $iKey => $oTag) {
         $aTags[$iKey] = $oTag->getTag()->getName();
     }
     $aKeywords[] = $aTags;
     $aKeywords[] = Settings::getSetting('frontend', 'keywords', '');
     $aKeywords[] = $this->getActivePageString()->getMetaKeywords();
     $aResult = array();
     foreach ($aKeywords as $iKey => $mKeywords) {
         if (!is_array($mKeywords)) {
             $mKeywords = explode(',', $mKeywords);
         }
         foreach ($mKeywords as $sKeyword) {
             $sKeyword = trim($sKeyword);
             if (!isset($aResult[$sKeyword]) && $sKeyword !== '') {
                 $aResult[$sKeyword] = true;
             }
         }
     }
     if ($bReturnArray) {
         return array_keys($aResult);
     }
     return implode(', ', array_keys($aResult));
 }
开发者ID:rapila,项目名称:cms-base,代码行数:31,代码来源:Page.php


示例6: executeTagList

 public function executeTagList()
 {
   $c = new Criteria();
   $c->add(sfSimpleBlogPostPeer::IS_PUBLISHED, true);
   $c->add(TaggingPeer::TAGGABLE_ID, TaggingPeer::TAGGABLE_ID.' = '. sfSimpleBlogPostPeer::ID, Criteria::CUSTOM);
   $this->tags = TagPeer::getPopulars($c);
 }
开发者ID:nibsirahsieu,项目名称:sfSimpleBlog15Plugin,代码行数:7,代码来源:BasesfSimpleBlogComponents.class.php


示例7: executeEditableTagsAutocomplete

 public function executeEditableTagsAutocomplete()
 {
     $this->my_str = $this->getRequestParameter('value');
     $c = new Criteria();
     $c->add(TagPeer::TRIPLE_VALUE, $this->my_str . "%", Criteria::LIKE);
     $this->tags = TagPeer::getAll($c);
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:7,代码来源:BasedeppTaggingActions.class.php


示例8: executeToggleApproved

 public function executeToggleApproved()
 {
     $tag = TagPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->forward404Unless($tag);
     $tag->setApproved(!$tag->getApproved());
     $tag->save();
     $this->redirect('tag/index');
 }
开发者ID:noose,项目名称:Planeta,代码行数:8,代码来源:actions.class.php


示例9: retrieveTagsFromTTPK

 public static function retrieveTagsFromTTPK($id)
 {
     $c = new Criteria();
     $c->add(OppTagHasTtPeer::TESEOTT_ID, $id);
     $c->addJoin(OppTagHasTtPeer::TAG_ID, TagPeer::ID);
     $c->addAscendingOrderByColumn(TagPeer::TRIPLE_VALUE);
     return TagPeer::doSelect($c);
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:8,代码来源:OppTeseottPeer.php


示例10: executeShow

 /**
  * Executes index action
  *
  */
 public function executeShow()
 {
     $c = new Criteria();
     $c->add(TagPeer::NORMALIZED_TAG, $this->getRequestParameter('tag'));
     $this->tag = TagPeer::doSelectOne($c);
     $this->events = EventPeer::getTaggedEvents($this->getRequestParameter('tag'));
     $this->forward404Unless($this->events);
 }
开发者ID:soon0009,项目名称:EMS,代码行数:12,代码来源:actions.class.php


示例11: getTags

 public function getTags()
 {
     $c = new Criteria();
     $c->add(OppTagHasTtPeer::TESEOTT_ID, $this->getId());
     $c->addJoin(OppTagHasTtPeer::TAG_ID, TagPeer::ID);
     $c->addAscendingOrderByColumn(TagPeer::TRIPLE_VALUE);
     return TagPeer::doSelect($c);
 }
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:8,代码来源:OppTeseott.php


示例12: hasPeerFieldName

 public function hasPeerFieldName($fieldName)
 {
     if (strpos($fieldName, '.') === false) {
         $fieldName = strtoupper($fieldName);
         $fieldName = "tag.{$fieldName}";
     }
     $entryFields = TagPeer::getFieldNames(BasePeer::TYPE_COLNAME);
     return in_array($fieldName, $entryFields);
 }
开发者ID:DBezemer,项目名称:server,代码行数:9,代码来源:SphinxTagCriteria.php


示例13: generate

 public static function generate()
 {
     $urls = array();
     $tags = TagPeer::getPopularTags(500);
     $urls[] = new sitemapURL("tag/list", date('Y-m-d\\TH:i:s\\Z'), 'daily', 1.0);
     foreach ($tags as $tag) {
         $urls[] = new sitemapURL("tag/" . $tag['tag'], date('Y-m-d\\TH:i:s\\Z'), 'daily', 1.0);
     }
     return $urls;
 }
开发者ID:hoydaa,项目名称:snippets.hoydaa.org,代码行数:10,代码来源:tagSitemapGenerator.class.php


示例14: doClean

 protected function doClean($value)
 {
     $criteria = new Criteria();
     $criteria->add(TagPeer::JOTAG, $value);
     $object = TagPeer::doSelectOne($criteria);
     if (is_null($object)) {
         throw new sfValidatorError($this, 'invalid', array('value' => $value));
     }
     return $object->getId();
 }
开发者ID:psskhal,项目名称:symfony-sample,代码行数:10,代码来源:sfValidatorSearchTag.class.php


示例15: listTags

 private function listTags()
 {
     $c = new Criteria();
     $c->add(TagPeer::NAME, $this->getRequestParameter('name'));
     $tag = TagPeer::doSelectOne($c);
     $this->getResponse()->setTitle(sprintf('Planeta PHP.pl - Wpisy dla tagu: %s', $tag->getName()));
     $c = new Criteria();
     $c->addJoin(PostTagPeer::POST_ID, PostPeer::ID, Criteria::LEFT_JOIN);
     $c->add(PostTagPeer::TAG_ID, $tag->getId());
     return $c;
 }
开发者ID:noose,项目名称:Planeta,代码行数:11,代码来源:actions.class.php


示例16: getConfigurationModes

 public function getConfigurationModes()
 {
     $aResult = array();
     $aResult['templates'] = AdminManager::getSiteTemplatesForListOutput();
     $aResult['tags'] = array();
     foreach (TagPeer::doSelect(new Criteria()) as $oTag) {
         $aResult['tags'][] = array('name' => $oTag->getName(), 'count' => $oTag->countTagInstances(), 'id' => $oTag->getId());
     }
     $aResult['types'] = TagInstancePeer::getTaggedModels();
     return $aResult;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:11,代码来源:TagFrontendConfigWidgetModule.php


示例17: reloadByTag

 private function reloadByTag($tagId)
 {
     $c = new Criteria();
     $this->routeObject = TagPeer::retrieveByPK($tagId);
     $ids = TaggingPeer::getJobIdsByTag($this->routeObject);
     $c->add(JobPeer::ID, $ids, Criteria::IN);
     $this->route = "job_listby_tag";
     $this->propelType = "name";
     $this->renderStatus = true;
     $this->viewingCaption = " taggings for " . $this->routeObject->__toString();
     return $c;
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:12,代码来源:actions.class.php


示例18: getNamesForAutocomplete

 public static function getNamesForAutocomplete($q)
 {
     sfLoader::loadHelpers("Url");
     $c = new Criteria();
     $c->add(TagPeer::NAME, $q . "%", Criteria::LIKE);
     $c->setLimit(10);
     $names = array();
     $tags = TagPeer::doSelect($c);
     foreach ($tags as $tag) {
         $names[] = array("id" => $tag->getId(), "name" => $tag->getName(), "searchUrl" => url_for("job_listby_tag", $tag));
     }
     return $names;
 }
开发者ID:adatta02,项目名称:comp190-code,代码行数:13,代码来源:TaggingPeer.php


示例19: executeBadge

 /**
  * Handles badge action
  *
  * @param sfWebRequest $request Web request object
  */
 public function executeBadge($request)
 {
     $this->jotag = TagPeer::getFromField(TagPeer::JOTAG, $request->getParameter('jotag'));
     $this->forward404Unless($this->jotag && $this->jotag->getStatus() == TagPeer::ST_ACTIVE);
     // get badge
     $this->badge = $this->jotag->getBadge();
     // is authorized
     $this->authorized = TagPrivacyPeer::allowedToView($this->getUser(), $this->jotag);
     // reload
     $this->reload = $request->getParameter('reload') ? true : false;
     // build list of contact info
     $this->contacts = array();
     $jotag =& $this->jotag;
     if ($jotag->getTagEmailsJoinEmail(EmailPeer::buildConfirmedCriteria())) {
         foreach ($jotag->getTagEmailsJoinEmail(EmailPeer::buildConfirmedCriteria()) as $k => $email) {
             $this->contacts["EMAIL"][] = $email->getEmail()->getEmail($this->authorized);
         }
     }
     if ($jotag->getTagPhonesJoinPhone()) {
         foreach ($jotag->getTagPhonesJoinPhone() as $k => $phone) {
             $this->contacts["PHONE"][] = array("number" => $phone->getPhone()->getNumber($this->authorized), "exten" => $phone->getPhone()->getExten($this->authorized));
         }
     }
     if ($jotag->getTagUrlsJoinUrl()) {
         foreach ($jotag->getTagUrlsJoinUrl() as $k => $url) {
             $this->contacts["URL"][] = $url->getUrl()->getUrl($this->authorized);
         }
     }
     if ($jotag->getTagSNsJoinSN()) {
         foreach ($jotag->getTagSNsJoinSN() as $k => $sn) {
             $this->contacts["SN"][] = array("network" => $sn->getSN()->getNetwork(), "identifier" => $sn->getSN()->getIdentifier($this->authorized));
         }
     }
     if ($jotag->getTagIMsJoinIM()) {
         foreach ($jotag->getTagIMsJoinIM() as $k => $im) {
             $this->contacts["IM"][] = array("network" => $im->getIM()->getNetwork(), "identifier" => $im->getIM()->getIdentifier($this->authorized));
         }
     }
     if ($jotag->getTagCustomsJoinCustom()) {
         foreach ($jotag->getTagCustomsJoinCustom() as $k => $custom) {
             $this->contacts["CUSTOM"][] = array("netname" => $custom->getCustom()->getNetName(), "netid" => $custom->getCustom()->getNetId($this->authorized));
         }
     }
 }
开发者ID:psskhal,项目名称:symfony-sample,代码行数:49,代码来源:actions.class.php


示例20: executeIndex

 public function executeIndex()
 {
     $name = $this->getRequestParameter('tag', '');
     $c = new Criteria();
     if ($name) {
         $c->add(TagPeer::NAME, $name);
         $tag = TagPeer::doSelectOne($c);
         $this->forward404Unless($tag);
         $c->clear();
         $c->addJoin(PostTagPeer::POST_ID, PostPeer::ID, Criteria::LEFT_JOIN);
         $c->add(PostTagPeer::TAG_ID, $tag->getId());
     }
     $c->addDescendingOrderByColumn(PostPeer::CREATED_AT);
     $c->setLimit(sfConfig::get('app_posts_in_feed', 10));
     $c->add(PostPeer::DELETED, false);
     $posts = PostPeer::doSelect($c);
     $this->feed = $this->createFeed($posts, $name);
     ReaderPeer::increment();
 }
开发者ID:noose,项目名称:Planeta,代码行数:19,代码来源:actions.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP TagURI类代码示例发布时间:2022-05-23
下一篇:
PHP Tag类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap