本文整理汇总了PHP中JHelperTags::deleteTagData方法的典型用法代码示例。如果您正苦于以下问题:PHP JHelperTags::deleteTagData方法的具体用法?PHP JHelperTags::deleteTagData怎么用?PHP JHelperTags::deleteTagData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JHelperTags
的用法示例。
在下文中一共展示了JHelperTags::deleteTagData方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterDelete
/**
* The event which runs after deleting a record
*
* @param DataModel &$model The model which calls this event
* @param integer $oid The PK value of the record which was deleted
*
* @return void
*
* @throws \Exception Error message if failed to detele tags
*/
public function onAfterDelete(&$model, $oid)
{
$this->tagsHelper->typeAlias = $model->getContentType();
if (!$this->tagsHelper->deleteTagData($model, $oid)) {
throw new \Exception('Error deleting Tags');
}
}
示例2: onAfterDelete
/**
* The event which runs after deleting a record
*
* @param DataModel &$model The model which calls this event
* @param integer $oid The PK value of the record which was deleted
*
* @return boolean True to allow the deletion without errors
*/
public function onAfterDelete(&$model, $oid)
{
// If this resource has tags, delete the tags first
if ($model->hasTags()) {
$tagsHelper = new \JHelperTags();
$tagsHelper->typeAlias = $model->getContentType();
if (!$tagsHelper->deleteTagData($model, $oid)) {
throw new \Exception('Error deleting Tags');
}
}
}
示例3: onAfterDelete
/**
* The event which runs after deleting a record
*
* @param FOFTable &$table The table which calls this event
* @param integer $oid The PK value of the record which was deleted
*
* @return boolean True to allow the deletion without errors
*/
public function onAfterDelete(&$table, $oid)
{
// If this resource has tags, delete the tags first
if ($table->hasTags()) {
$tagsHelper = new JHelperTags();
$tagsHelper->typeAlias = $table->getAssetKey();
if (!$tagsHelper->deleteTagData($table, $oid)) {
$table->setError('Error deleting Tags');
return false;
}
}
}
示例4: delete
/**
* Override parent delete method to process tags
*
* @param integer $pk The primary key of the node to delete.
* @param boolean $children True to delete child nodes, false to move them up a level.
*
* @return boolean True on success.
*
* @since 3.1
* @throws UnexpectedValueException
*/
public function delete($pk = null, $children = true)
{
$result = parent::delete($pk);
$this->tagsHelper->typeAlias = $this->extension . '.category';
return $result && $this->tagsHelper->deleteTagData($this, $pk);
}
示例5: onBeforeDelete
/**
* Pre-processor for $table->delete($pk)
*
* @param mixed $pk An optional primary key value to delete. If not set the instance property value is used.
* @param string $tableKey The normal key of the table
*
* @return void
*
* @throws UnexpectedValueException
*/
public function onBeforeDelete($pk, $tableKey)
{
$this->parseTypeAlias();
$this->tagsHelper->deleteTagData($this->table, $pk);
}
示例6: deleteListItems
function deleteListItems($ids)
{
$this->onExecuteBefore('deleteListItems', array(&$ids));
$tags = new JHelperTags();
$table = $this->getTable('products');
$tags->typeAlias = 'com_ksenmart.product';
foreach ($ids as $id) {
$table->load($id);
$tags->deleteTagData($table, $id);
$query = $this->_db->getQuery(true);
$query->delete('#__ksenmart_product_properties_values')->where('product_id=' . $id);
$this->_db->setQuery($query);
$this->_db->query();
$query = $this->_db->getQuery(true);
$query->delete('#__ksenmart_products_categories')->where('product_id=' . $id);
$this->_db->setQuery($query);
$this->_db->query();
$query = $this->_db->getQuery(true);
$query->delete('#__ksenmart_products_child_groups')->where('product_id=' . $id);
$this->_db->setQuery($query);
$this->_db->query();
$query = $this->_db->getQuery(true);
$query->delete('#__ksenmart_products_relations')->where('product_id=' . $id);
$this->_db->setQuery($query);
$this->_db->query();
$query = $this->_db->getQuery(true);
$query->delete('#__ksenmart_products')->where('id=' . $id);
$this->_db->setQuery($query);
$this->_db->query();
KSMedia::deleteItemMedia($id, 'product');
$query = $this->_db->getQuery(true);
$query->select('id')->from('#__ksenmart_products')->where('parent_id=' . $id);
$this->_db->setQuery($query);
$childs = $this->_db->loadColumn();
if (count($childs) > 0) {
$this->deleteListItems($childs);
}
}
$this->onExecuteAfter('deleteListItems', array(&$ids));
return true;
}
示例7: delete
/**
* Override parent delete method to delete tags information.
*
* @param integer $pk Primary key to delete.
*
* @return boolean True on success.
*
* @since 3.1
* @throws UnexpectedValueException
*/
public function delete($pk = null)
{
$result = parent::delete($pk);
return $result && $this->tagsHelper->deleteTagData($this, $pk);
}
示例8: delete
/**
* Override parent delete method to delete tags information.
*
* @param integer $pk Primary key to delete.
*
* @return boolean True on success.
*
* @since 3.1
* @throws UnexpectedValueException
*/
public function delete($pk = null)
{
$result = parent::delete($pk);
$this->tagsHelper->typeAlias = 'com_content.article';
return $result && $this->tagsHelper->deleteTagData($this, $pk);
}
示例9: deleteUCM
function deleteUCM($type, $elements)
{
if (!isset($this->structure[$type]) || !$this->_isCompatible) {
return false;
}
$structure = $this->structure[$type];
$component = 'hikashop';
if (!empty($structure['component'])) {
$component = $structure['component'];
}
$alias = 'com_' . $component . '.' . $structure['table'];
$tagsHelper = new JHelperTags();
$tagsHelper->typeAlias = $alias;
$id = $structure['id'];
$tagsTable = new JHikaShopTagTable($structure, null);
$ret = true;
foreach ($elements as $element) {
if (empty($element)) {
continue;
}
$tagsTable->{$id} = $element;
if (!$tagsHelper->deleteTagData($tagsTable, $element)) {
$ret = false;
}
}
return $ret;
}