From b79bfefc1217a5ce4f682af402ba9f86dd6fcc07 Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Wed, 4 Oct 2023 10:28:03 +0700 Subject: [PATCH 1/4] mark deprecated funtions --- ProductCommentCriterion.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ProductCommentCriterion.php b/ProductCommentCriterion.php index 7e412aa..01ea988 100644 --- a/ProductCommentCriterion.php +++ b/ProductCommentCriterion.php @@ -47,6 +47,9 @@ class ProductCommentCriterion extends ObjectModel ], ]; + /** + * @deprecated 6.0.0 + */ public function delete() { if (!parent::delete()) { @@ -96,6 +99,8 @@ public function update($nullValues = false) * Link a Comment Criterion to a product * * @return bool succeed + * + * @deprecated 6.0.0 */ public function addProduct($id_product) { @@ -113,6 +118,8 @@ public function addProduct($id_product) * Link a Comment Criterion to a category * * @return bool succeed + * + * @deprecated 6.0.0 */ public function addCategory($id_category) { From b05b70d85a46fb3c5e70330de7ae643177a7e631 Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:23:01 +0700 Subject: [PATCH 2/4] mark deprecated functions since v4.0.0 n v6.0.0 --- ProductComment.php | 8 ++++++++ ProductCommentCriterion.php | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ProductComment.php b/ProductComment.php index f3fc56a..02a3188 100644 --- a/ProductComment.php +++ b/ProductComment.php @@ -438,6 +438,8 @@ public static function deleteUsefulness($id_product_comment) * Report comment * * @return bool + * + * @deprecated 4.0.0 - migrated to controllers/front/ReportComment and src/Entity/ProductCommentReport */ public static function reportComment($id_product_comment, $id_customer) { @@ -450,6 +452,8 @@ public static function reportComment($id_product_comment, $id_customer) * Comment already report * * @return bool + * + * @deprecated 4.0.0 - migrated to controllers/front/ReportComment and src/Entity/ProductCommentReport */ public static function isAlreadyReport($id_product_comment, $id_customer) { @@ -464,6 +468,8 @@ public static function isAlreadyReport($id_product_comment, $id_customer) * Set comment usefulness * * @return bool + * + * @deprecated 4.0.0 - migrated to controllers/front/UpdateCommentUsefulness and src/Entity/ProductCommentUsefulness */ public static function setCommentUsefulness($id_product_comment, $usefulness, $id_customer) { @@ -476,6 +482,8 @@ public static function setCommentUsefulness($id_product_comment, $usefulness, $i * Usefulness already set * * @return bool + * + * @deprecated 4.0.0 - migrated to controllers/front/UpdateCommentUsefulness and src/Entity/ProductCommentUsefulness */ public static function isAlreadyUsefulness($id_product_comment, $id_customer) { diff --git a/ProductCommentCriterion.php b/ProductCommentCriterion.php index 01ea988..c65e303 100644 --- a/ProductCommentCriterion.php +++ b/ProductCommentCriterion.php @@ -48,7 +48,7 @@ class ProductCommentCriterion extends ObjectModel ]; /** - * @deprecated 6.0.0 + * @deprecated 6.0.0 - migrated to src/Repository/ProductCommentCriterionRepository */ public function delete() { @@ -100,7 +100,7 @@ public function update($nullValues = false) * * @return bool succeed * - * @deprecated 6.0.0 + * @deprecated 6.0.0 - migrated to src/Repository/ProductCommentCriterionRepository */ public function addProduct($id_product) { @@ -119,7 +119,7 @@ public function addProduct($id_product) * * @return bool succeed * - * @deprecated 6.0.0 + * @deprecated 6.0.0 - migrated to src/Repository/ProductCommentCriterionRepository */ public function addCategory($id_category) { From d6078d14b76c89a42b31042f025ee3a35bfd5b73 Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:24:14 +0700 Subject: [PATCH 3/4] correct function name --- upgrade/install-6.0.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upgrade/install-6.0.3.php b/upgrade/install-6.0.3.php index cdb05fb..b32ad47 100644 --- a/upgrade/install-6.0.3.php +++ b/upgrade/install-6.0.3.php @@ -27,7 +27,7 @@ exit; } -function upgrade_module_6_0_1($object) +function upgrade_module_6_0_3($object) { return Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'product_comment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci') && Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'product_comment_criterion` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci') From cbe39e0325d9ad2a7236a44d349239554c0798d1 Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:28:34 +0700 Subject: [PATCH 4/4] CS fix --- ProductComment.php | 8 ++++---- ProductCommentCriterion.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ProductComment.php b/ProductComment.php index 02a3188..53cca30 100644 --- a/ProductComment.php +++ b/ProductComment.php @@ -438,7 +438,7 @@ public static function deleteUsefulness($id_product_comment) * Report comment * * @return bool - * + * * @deprecated 4.0.0 - migrated to controllers/front/ReportComment and src/Entity/ProductCommentReport */ public static function reportComment($id_product_comment, $id_customer) @@ -452,7 +452,7 @@ public static function reportComment($id_product_comment, $id_customer) * Comment already report * * @return bool - * + * * @deprecated 4.0.0 - migrated to controllers/front/ReportComment and src/Entity/ProductCommentReport */ public static function isAlreadyReport($id_product_comment, $id_customer) @@ -468,7 +468,7 @@ public static function isAlreadyReport($id_product_comment, $id_customer) * Set comment usefulness * * @return bool - * + * * @deprecated 4.0.0 - migrated to controllers/front/UpdateCommentUsefulness and src/Entity/ProductCommentUsefulness */ public static function setCommentUsefulness($id_product_comment, $usefulness, $id_customer) @@ -482,7 +482,7 @@ public static function setCommentUsefulness($id_product_comment, $usefulness, $i * Usefulness already set * * @return bool - * + * * @deprecated 4.0.0 - migrated to controllers/front/UpdateCommentUsefulness and src/Entity/ProductCommentUsefulness */ public static function isAlreadyUsefulness($id_product_comment, $id_customer) diff --git a/ProductCommentCriterion.php b/ProductCommentCriterion.php index c65e303..0a73991 100644 --- a/ProductCommentCriterion.php +++ b/ProductCommentCriterion.php @@ -99,7 +99,7 @@ public function update($nullValues = false) * Link a Comment Criterion to a product * * @return bool succeed - * + * * @deprecated 6.0.0 - migrated to src/Repository/ProductCommentCriterionRepository */ public function addProduct($id_product) @@ -118,7 +118,7 @@ public function addProduct($id_product) * Link a Comment Criterion to a category * * @return bool succeed - * + * * @deprecated 6.0.0 - migrated to src/Repository/ProductCommentCriterionRepository */ public function addCategory($id_category)