本文整理汇总了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);
}
}
示例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();
}
示例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();
}
}
示例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();
}
示例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;
}
示例6: delete
/**
* Deletes a tag
*
* @param Tag $tag The tag to be deleted
**/
public static function delete($tag)
{
$tag->delete();
}
示例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']);
示例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'))));
示例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');
}
示例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'));
}