Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions src/Entity/ProductCommentCriterion.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
*/
Expand Down Expand Up @@ -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
*/
Expand Down
54 changes: 0 additions & 54 deletions src/Repository/ProductCommentCriterionRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Loading