[*] MO : productComments - It's now possible to delete comments, beside moderation

This commit is contained in:
bMancone
2011-08-29 16:21:57 +00:00
parent 5c64f12662
commit 081b8e7aa5
5 changed files with 110 additions and 2 deletions
@@ -256,6 +256,21 @@ class ProductComment extends ObjectModel
ORDER BY pc.`date_add` DESC'));
}
/**
* Get all comments
*
* @return array Comments
*/
public static function getAll()
{
return (Db::getInstance()->ExecuteS('
SELECT pc.`id_product_comment`, pc.`id_product`, IF(c.id_customer, CONCAT(c.`firstname`, \' \', c.`lastname`), pc.customer_name) customer_name, pc.`content`, pc.`grade`, pc.`date_add`, pl.`name`
FROM `'._DB_PREFIX_.'product_comment` pc
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = pc.`id_customer`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = pc.`id_product` AND pl.`id_lang` = '.(int)Context::getContext()->language->id.Context::getContext()->shop->sqlLang('pl').')
ORDER BY pc.`date_add` DESC'));
}
/**
* Validate a comment
*