* Add a function to activate a product.
This commit is contained in:
@@ -893,6 +893,25 @@ class productModel extends model
|
||||
if(!dao::isError()) return common::createChanges($oldProduct, $product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a product.
|
||||
*
|
||||
* @param int $productID.
|
||||
* @access public
|
||||
* @return bool | array
|
||||
*/
|
||||
public function activate($productID)
|
||||
{
|
||||
$oldProduct = $this->getById($productID);
|
||||
$product = (object)array('status' => 'normal');
|
||||
|
||||
$this->dao->update(TABLE_PRODUCT)->data($product)->where('id')->eq((int)$productID)->exec();
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
return common::createChanges($oldProduct, $product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage line.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user