diff --git a/src/Entity/ProductCommentCriterion.php b/src/Entity/ProductCommentCriterion.php index 7a76c6a..bb7ff07 100644 --- a/src/Entity/ProductCommentCriterion.php +++ b/src/Entity/ProductCommentCriterion.php @@ -64,13 +64,6 @@ class ProductCommentCriterion */ private $active = false; - /** - * @var array - * - * @deprecated 7.0.0 - use criterionLangs instead - */ - private $names; - /** * @ORM\OneToMany(targetEntity="PrestaShop\Module\ProductComment\Entity\ProductCommentCriterionLang", cascade={"persist", "remove"}, mappedBy="productcommentcriterion") */ @@ -136,30 +129,6 @@ public function getCriterionName(): string return $criterionLang->getName(); } - /** - * @return array - * - * @deprecated 7.0.0 - migrated to Form\ProductCommentCriterionFormDataProvider - */ - public function getNames() - { - return $this->names; - } - - /** - * @param array $langNames - * - * @return ProductCommentCriterion - * - * @deprecated 7.0.0 - */ - public function setNames($langNames) - { - $this->names = $langNames; - - return $this; - } - /** * @return array */ diff --git a/src/Repository/ProductCommentCriterionRepository.php b/src/Repository/ProductCommentCriterionRepository.php index 1507208..6b142af 100644 --- a/src/Repository/ProductCommentCriterionRepository.php +++ b/src/Repository/ProductCommentCriterionRepository.php @@ -88,16 +88,6 @@ public function remove(ProductCommentCriterion $entity, bool $flush = false): vo } } - /** - * @deprecated 7.0.0 - cascade remove by Entity setting instead - */ - private function deleteLangs($criterion): int - { - return $this->connection->executeUpdate(' - DELETE FROM `' . _DB_PREFIX_ . 'product_comment_criterion_lang` - WHERE `id_product_comment_criterion` = ' . $criterion->getId()); - } - private function deleteCategories($criterion): int { return $this->connection->executeUpdate(' @@ -166,34 +156,6 @@ public function update(ProductCommentCriterion $criterion): int return $res; } - /** - * @deprecated 7.0.0 - migrated to Form\ProductCommentCriterionFormDataHandler - */ - private function updateLangs($criterion): int - { - $res = 0; - $criterionId = $criterion->getId(); - foreach ($criterion->getNames() as $key => $value) { - $qb = $this->connection->createQueryBuilder(); - $qb - ->insert(_DB_PREFIX_ . 'product_comment_criterion_lang') - ->values( - [ - 'id_product_comment_criterion' => '?', - 'id_lang' => '?', - 'name' => '?', - ] - ) - ->setParameter(0, $criterionId) - ->setParameter(1, $key) - ->setParameter(2, $value) - ; - $res += $this->connection->executeUpdate($qb->getSQL(), $qb->getParameters(), $qb->getParameterTypes()); - } - - return $res; - } - private function updateCategories($criterion): int { $res = 0; @@ -342,20 +304,4 @@ public function getTypes() 3 => $sfTranslator->trans('Restricted to some products', [], 'Modules.Productcomments.Admin'), ]; } - - /** - * @return ProductCommentCriterion - * - * @deprecated 7.0.0 - use standard find() instead - */ - public function findRelation($id_criterion) - { - if ($id_criterion > 0) { - $criterion = $this->find($id_criterion); - } else { - $criterion = new ProductCommentCriterion(); - } - - return $criterion; - } }