private function _checkReportedComment() { $action = Tools::getValue('action'); if (empty($action) === false) { $product_comments = Tools::getValue('id_product_comment'); if (count($product_comments)) { require_once dirname(__FILE__) . '/ProductComment.php'; switch ($action) { case 'accept': foreach ($product_comments as $id_product_comment) { if (!$id_product_comment) { continue; } $comment = new ProductComment((int) $id_product_comment); $comment->validate(); ProductComment::deleteReports((int) $id_product_comment); } break; case 'delete': foreach ($product_comments as $id_product_comment) { if (!$id_product_comment) { continue; } $comment = new ProductComment((int) $id_product_comment); $comment->delete(); ProductComment::deleteGrades((int) $id_product_comment); ProductComment::deleteReports((int) $id_product_comment); ProductComment::deleteUsefulness((int) $id_product_comment); } break; default: } } } }
/** * Delete a comment, grade and report data * * @return boolean succeed */ public function delete() { parent::delete(); ProductComment::deleteGrades($this->id); ProductComment::deleteReports($this->id); ProductComment::deleteUsefulness($this->id); }