當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。