本文整理匯總了PHP中VmModel::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP VmModel::remove方法的具體用法?PHP VmModel::remove怎麽用?PHP VmModel::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類VmModel
的用法示例。
在下文中一共展示了VmModel::remove方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: remove
function remove($ids)
{
if (!vmAccess::manager('orderstatus')) {
vmWarn('Insufficient permissions to remove orderstatus');
return false;
}
return parent::remove($ids);
}
示例2: remove
/**
* Delete all categories selected
* note : added checkOwn() and return before xref tables to prevent bugs.
* @author jseros, Patrick Kohl
* @param array $cids categories to remove
* @return boolean if the item remove was successful
*/
public function remove($cids)
{
$cids = parent::remove($cids);
if (empty($cids)) {
return false;
}
$cidInString = implode(',', $cids);
//Delete media xref
$query = 'DELETE FROM `#__virtuemart_category_medias` WHERE `virtuemart_category_id` IN (' . $cidInString . ') ';
$this->_db->setQuery($query);
if (!$this->_db->execute()) {
vmError($this->_db->getErrorMsg());
}
//deleting product relations
$query = 'DELETE FROM `#__virtuemart_product_categories` WHERE `virtuemart_category_id` IN (' . $cidInString . ') ';
$this->_db->setQuery($query);
if (!$this->_db->execute()) {
vmError($this->_db->getErrorMsg());
}
//deleting product relations
$query = 'DELETE FROM `#__virtuemart_category_categories` WHERE `category_child_id` IN (' . $cidInString . ') ';
$this->_db->setQuery($query);
if (!$this->_db->execute()) {
vmError($this->_db->getErrorMsg());
}
//updating parent relations
$query = 'UPDATE `#__virtuemart_category_categories` SET `category_parent_id` = 0 WHERE `category_parent_id` IN (' . $cidInString . ') ';
$this->_db->setQuery($query);
if (!$this->_db->execute()) {
vmError($this->_db->getErrorMsg());
}
return true;
}