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


PHP Tag::delete方法代码示例

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


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

示例1: delete

 /**
  * Delete a tag in the tag database.
  *
  * @return string Standard JSON envelope
  */
 public function delete($tag)
 {
     getAuthentication()->requireAuthentication();
     $res = Tag::delete($tag);
     if ($res) {
         return $this->noContent('Tag deleted successfully', true);
     } else {
         return $this->error('Tag could not be deleted', false);
     }
 }
开发者ID:nicolargo,项目名称:frontend,代码行数:15,代码来源:ApiTagController.php

示例2: merge

 /**
  * Merge a tag into this one, bringing with it all Assets and JobLists.
  *
  * @param \App\Model\Tag $otherTag
  */
 public function merge(Tag $otherTag)
 {
     if ($otherTag->id === $this->id) {
         return;
     }
     $params = ['t' => $this->id, 'ot' => $otherTag->id];
     \DB::update("UPDATE IGNORE asset_tag SET tag_id = :t WHERE tag_id = :ot", $params);
     \DB::delete("DELETE FROM asset_tag WHERE tag_id = :ot", ['ot' => $otherTag->id]);
     \DB::update("UPDATE IGNORE job_list_tag SET tag_id = :t WHERE tag_id = :ot", $params);
     \DB::delete("DELETE FROM job_list_tag WHERE tag_id = :ot", ['ot' => $otherTag->id]);
     $otherTag->delete();
 }
开发者ID:samwilson,项目名称:asset-manager,代码行数:17,代码来源:Tag.php

示例3: resolveCategoryTag

function resolveCategoryTag(Tag $tag)
{
    $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
    $c->add(categoryPeer::PARTNER_ID, $tag->getPartnerId());
    $categoryFilter = new categoryFilter();
    $categoryFilter->set('_mlikeand_tags', $tag->getTag());
    $categoryFilter->attachToCriteria($c);
    $count = $c->getRecordsCount();
    if (!$count) {
        $tag->delete();
    }
}
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:resolveTags.php

示例4: deleteTag

/**
* Delete a tag. Requires login and user must be owner of the tag.
*
* @param string $tagid
* @return Result or Error
*/
function deleteTag($tagid)
{
    $tagobj = new Tag($tagid);
    return $tagobj->delete();
}
开发者ID:uniteddiversity,项目名称:LiteMap,代码行数:11,代码来源:apilib.php

示例5: resolveCategoryTag

 /**
  * @param Tag $tag
  * @return int
  */
 private function resolveCategoryTag(Tag $tag)
 {
     $c = KalturaCriteria::create(categoryPeer::OM_CLASS);
     $c->add(categoryPeer::PARTNER_ID, $tag->getPartnerId());
     $categoryFilter = new categoryFilter();
     $tagString = str_replace(kTagFlowManager::$specialCharacters, kTagFlowManager::$specialCharactersReplacement, $tag->getTag());
     $categoryFilter->set('_mlikeand_tags', $tagString);
     $categoryFilter->attachToCriteria($c);
     $c->applyFilters();
     $count = $c->getRecordsCount();
     if (!$count) {
         $tag->delete();
         return 1;
     } else {
         $tag->setInstanceCount($count);
         $tag->save();
         return 1;
     }
     return 0;
 }
开发者ID:DBezemer,项目名称:server,代码行数:24,代码来源:TagService.php

示例6: delete

 /**
  * Deletes a tag
  *
  * @param Tag $tag The tag to be deleted
  **/
 public static function delete($tag)
 {
     $tag->delete();
 }
开发者ID:psaintlaurent,项目名称:Habari,代码行数:9,代码来源:tags.php

示例7: Tag

 case 'get_labels':
     $labels = Label::get_display(Label::get_all_labels());
     $results['labels'] = $labels;
     break;
 case 'add_tag':
     debug_event('tag.ajax', 'Adding new tag...', '5');
     Tag::add_tag_map($_GET['type'], $_GET['object_id'], $_GET['tag_id']);
     break;
 case 'add_tag_by_name':
     debug_event('tag.ajax', 'Adding new tag by name...', '5');
     Tag::add($_GET['type'], $_GET['object_id'], $_GET['tag_name'], false);
     break;
 case 'delete':
     debug_event('tag.ajax', 'Deleting tag...', '5');
     $tag = new Tag($_GET['tag_id']);
     $tag->delete();
     header('Location: ' . AmpConfig::get('web_path') . '/browse.php?action=tag');
     exit;
 case 'remove_tag_map':
     debug_event('tag.ajax', 'Removing tag map...', '5');
     $tag = new Tag($_GET['tag_id']);
     $tag->remove_map($_GET['type'], $_GET['object_id']);
     break;
 case 'browse_type':
     $browse = new Browse($_GET['browse_id']);
     $browse->set_filter('object_type', $_GET['type']);
     $browse->store();
     break;
 case 'add_filter':
     $browse = new Browse($_GET['browse_id']);
     $browse->set_filter('tag', $_GET['tag_id']);
开发者ID:nioc,项目名称:ampache,代码行数:31,代码来源:tag.ajax.php

示例8: html

<?php

require __DIR__ . '/../../../init.php';
$tag = new Tag($db, $user->get_id());
$error = array();
if (empty($_GET['name']) && empty($_POST['name'])) {
    redirect('/tags');
}
if (isset($_POST['name'])) {
    $tag->delete($_POST['name']);
    redirect('/tags');
}
$name = $_GET['name'];
echo html(title('Homespot - Delete Tag'), navigation($user->is_authed()) . content(h1("Delete Tag - " . $_GET['name']) . form('post', hidden('name', $_GET['name']) . submit('DELETE'))));
开发者ID:doodzik,项目名称:homespot_legacy,代码行数:14,代码来源:index.php

示例9: delete

 public function delete()
 {
     if ($this->f3->exists('PARAMS.tok')) {
         //getIdByTok
         $getIdByTok = new Tag($this->db);
         $getIdByTok->getIdByTok($this->f3->get('PARAMS.tok'));
         $tid = $this->f3->get('ID.id');
         //del by ID
         $tags = new Tag2Item($this->db);
         $loaderase = $tags->getByTagId($tid);
         if (count($loaderase) > 0) {
             foreach ($loaderase as $t) {
                 $itemid = $t['id'];
                 $deltags = new Tag2Item($this->db);
                 $deltags->delete($itemid);
             }
         }
         $tg = new Tag($this->db);
         $tg->delete($this->f3->get('PARAMS.tok'));
     }
     $this->f3->set('COOKIE.message', 'Tag was deleted');
     $this->f3->set('COOKIE.messagetype', 'alert-info hide5s');
     $this->f3->reroute('/t');
 }
开发者ID:Mumcio,项目名称:bookmark-manager,代码行数:24,代码来源:TagController.php

示例10: deleteTag

 public function deleteTag(Tag $tag)
 {
     $tag->delete();
     return Redirect::route('tag.list')->with('success', Lang::choice('messages.Tags', 1) . ' ' . trans('messages.is deleted'));
 }
开发者ID:rituzy,项目名称:iblog,代码行数:5,代码来源:TagController.php


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