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


PHP Tag::getId方法代码示例

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


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

示例1: add

 /**
  * Add a Tag in the collection.
  *
  * @param Tag $tag
  *
  * @throws \Exception If the tag exist in the collection
  */
 public function add(Tag $tag)
 {
     $tagId = $tag->getId();
     foreach ($this->collection as $tagItem) {
         $tagIdTmp = $tagItem->getId();
         if ($tagId == $tagIdTmp) {
             throw new \Exception('The tag is already included in this collection');
         }
     }
     $this->collection[] = $tag;
 }
开发者ID:neburs,项目名称:Import-Video-Test,代码行数:18,代码来源:TagCollection.php

示例2: newTagInstance

 public static function newTagInstance($sTagName, $sModelName, $iTaggedItemId)
 {
     $sTagName = StringUtil::normalize($sTagName);
     $oTag = TagPeer::retrieveByName($sTagName);
     if ($oTag === null) {
         $oTag = new Tag();
         $oTag->setName($sTagName);
         $oTag->save();
     }
     $oTagInstance = self::retrieveByPK($oTag->getId(), $iTaggedItemId, $sModelName);
     if ($oTagInstance !== null) {
         throw new Exception("Instance of this tag does already exist");
     }
     $oTagInstance = new TagInstance();
     $oTagInstance->setTag($oTag);
     $oTagInstance->setModelName($sModelName);
     $oTagInstance->setTaggedItemId($iTaggedItemId);
     $oTagInstance->save();
     return $oTagInstance;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:20,代码来源:TagInstancePeer.php

示例3: addObjectTag

 /**
  * Add tags for an object
  *
  * @access public
  * @param string $tag_name tag to be added
  * @param ProjectDataObject $obj
  * @return null
  */
 function addObjectTag($tag_name, ApplicationDataObject $obj)
 {
     $tag_name = trim($tag_name);
     if (!(isset($obj) && $obj && $obj instanceof ApplicationDataObject)) {
         return true;
     }
     $prevTags = Tags::getTagNamesByObject($obj);
     if ($prevTags) {
         foreach ($prevTags as $tag_iter) {
             if (strcmp($tag_name, $tag_iter) == 0) {
                 return true;
             }
             //tag already added
         }
     }
     if (strcmp($tag_name, '')) {
         $exists = true;
         if (Tags::countObjectsByTag($tag_name) <= 0) {
             $exists = false;
         }
         $tag = new Tag();
         $tag->setTag($tag_name);
         $tag->setRelObjectId($obj->getId());
         $tag->setRelObjectManager(get_class($obj->manager()));
         $tag->setIsPrivate(false);
         $tag->save();
         if (!$exists) {
             $real_tag = self::findById($tag->getId());
             evt_add("tag added", array("name" => $real_tag->getTag()));
         }
     }
     // if
     return true;
 }
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:42,代码来源:Tags.class.php

示例4: addTagTo

 /**
  * Add a tag to the Page given by the id
  */
 public static function addTagTo($sPageId, $mTag)
 {
     if ($mTag instanceof TagInstance) {
         $mTag = $mTag->getTag();
     }
     if ($mTag instanceof Tag) {
         $mTag = $mTag->getName();
     }
     $sTagName = StringUtil::normalize($mTag);
     $oTag = TagQuery::create()->findOneByName($sTagName);
     if ($oTag === null) {
         $oTag = new Tag();
         $oTag->setName($sTagName);
         $oTag->save();
     }
     $oTagInstance = TagInstanceQuery::create()->findPk(array($oTag->getId(), $sPageId, "Page"));
     if ($oTagInstance !== null) {
         return $oTagInstance;
     }
     $oTagInstance = new TagInstance();
     $oTagInstance->setTag($oTag);
     $oTagInstance->setModelName("Page");
     $oTagInstance->setTaggedItemId($sPageId);
     $oTagInstance->save();
     return $oTagInstance;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:29,代码来源:BasePage.php

示例5: findTaggedByApplication

 /**
  * All the applicants in an application
  * @param Application $application
  * @param Tag $tag
  * @return array
  */
 public function findTaggedByApplication(Application $application, Tag $tag)
 {
     $queryBuilder = $this->_em->createQueryBuilder();
     $queryBuilder->from('Jazzee\\Entity\\Applicant', 'applicant');
     $queryBuilder->add('select', 'applicant');
     $queryBuilder->leftJoin('applicant.tags', 'tags');
     $queryBuilder->where('applicant.application = :applicationId');
     $queryBuilder->setParameter('applicationId', $application->getId());
     $queryBuilder->andWhere('applicant.deactivated=false');
     $queryBuilder->andWhere(':tagId MEMBER OF applicant.tags');
     $queryBuilder->setParameter('tagId', $tag->getId());
     $queryBuilder->orderBy('applicant.lastName, applicant.firstName');
     return $queryBuilder->getQuery()->getResult();
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:20,代码来源:ApplicantRepository.php

示例6: filterByTag

 /**
  * Filter the query by a related Tag object
  *
  * @param   Tag|PropelObjectCollection $tag The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 TagInstanceQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByTag($tag, $comparison = null)
 {
     if ($tag instanceof Tag) {
         return $this->addUsingAlias(TagInstancePeer::TAG_ID, $tag->getId(), $comparison);
     } elseif ($tag instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(TagInstancePeer::TAG_ID, $tag->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByTag() only accepts arguments of type Tag or PropelCollection');
     }
 }
开发者ID:rapila,项目名称:cms-base,代码行数:22,代码来源:BaseTagInstanceQuery.php

示例7: setTag

 /**
  * Declares an association between this object and a Tag object.
  *
  * @param                  Tag $v
  * @return TagInstance The current object (for fluent API support)
  * @throws PropelException
  */
 public function setTag(Tag $v = null)
 {
     if ($v === null) {
         $this->setTagId(NULL);
     } else {
         $this->setTagId($v->getId());
     }
     $this->aTag = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Tag object, it will not be re-added.
     if ($v !== null) {
         $v->addTagInstance($this);
     }
     return $this;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:22,代码来源:BaseTagInstance.php

示例8: delete

 public function delete(Tag &$tag)
 {
     $this->db->query("delete from Tag where id=" . $tag->getId());
 }
开发者ID:basvandervlies,项目名称:pakiti3,代码行数:4,代码来源:TagDao.php

示例9: trim

include_once "config.php";
include_once "class/Emailer.class.php";
$background_color = 'white';
include_once 'includes/header.inc.php';
$idcontact = (int) $_GET['idc'];
$iduser = (int) trim($_GET['idu']);
$idtag = (int) trim($_GET['idt']);
$do_contact = new Contact();
$do_contact->getId($idcontact);
$firstname = $do_contact->firstname;
$lastname = $do_contact->lastname;
$email_address = $do_contact->getDefaultEmailId($idcontact);
$message = '';
$do_tag = new Tag();
if ($do_tag->isTagValidTagId($idtag) === true) {
    $do_tag->getId($idtag);
    $tag_name = $do_tag->tag_name;
    $do_user = new User();
    $do_user->getId($iduser);
    $user_idcontact = $do_user->idcontact;
    $q_auto_resp = new sqlQuery($GLOBALS['conx']);
    /*$sql_auto_resp = "SELECT ar.name,arem.subject FROM autoresponder AS ar 
       INNER JOIN autoresponder_email AS arem ON ar.idautoresponder = arem.idautoresponder
    		WHERE ar.iduser = {$iduser} AND ar.tag_name = '{$tag_name}'";*/
    $sql_auto_resp = "SELECT `name` FROM autoresponder\n        WHERE iduser = {$iduser} AND tag_name = '{$tag_name}'";
    $q_auto_resp->query($sql_auto_resp);
    $responder = "";
    $resp_email_subj = "";
    if ($q_auto_resp->getNumRows()) {
        $q_auto_resp->fetch();
        $responder = $q_auto_resp->getData("name");
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:31,代码来源:unsubscribe_auto_responder.php

示例10: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param Tag $obj A Tag object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         TagPeer::$instances[$key] = $obj;
     }
 }
开发者ID:rapila,项目名称:cms-base,代码行数:22,代码来源:BaseTagPeer.php

示例11: deleteTagById

 /**
  * deleteTagById 
  * Delete a tag using the tag primary key.
  * Used in the ajax delete in the contact.php
  * it fetch the tag name and call the deleteTab()
  * @param idtag 
  * @param idcontact
  * @see deleteTab(), eventDeleteTag()
  */
 public function deleteTagById($idtag, $idcontact = 0)
 {
     if (empty($idcontact)) {
         $idcontact = $this->idcontact;
     }
     $tag_to_delete = new Tag();
     if ($tag_to_delete->getId($idtag)) {
         $this->deleteTag($tag_to_delete->tag_name, $idcontact);
     } else {
         $this->setLog("\n ContactView Tag delete: No tag found to delete");
     }
 }
开发者ID:jacquesbagui,项目名称:ofuz,代码行数:21,代码来源:ContactView.class.php

示例12: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Tag $value A Tag object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Tag $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         if (isset(self::$instances[$key]) || count(self::$instances) < kConf::get('max_num_instances_in_pool')) {
             self::$instances[$key] = $obj;
             kMemoryManager::registerPeer('TagPeer');
         }
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:24,代码来源:BaseTagPeer.php

示例13: prune

 /**
  * Exclude object from result
  *
  * @param   Tag $tag Object to remove from the list of results
  *
  * @return TagQuery The current query, for fluid interface
  */
 public function prune($tag = null)
 {
     if ($tag) {
         $this->addUsingAlias(TagPeer::ID, $tag->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
开发者ID:rapila,项目名称:cms-base,代码行数:14,代码来源:BaseTagQuery.php

示例14: setTag

 /**
  * Declares an association between this object and a Tag object.
  *
  * @param      Tag $v
  * @return     void
  * @throws     PropelException
  */
 public function setTag($v)
 {
     if ($v === null) {
         $this->setTagId(NULL);
     } else {
         $this->setTagId($v->getId());
     }
     $this->aTag = $v;
 }
开发者ID:noose,项目名称:Planeta,代码行数:16,代码来源:BasePostTag.php


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