本文整理汇总了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;
}