Skip to content

Commit ee9a2d9

Browse files
authored
Merge pull request #220 from ga-devfront/release/remove-dreprecated
Remove deprecated 7.0.0 functions
2 parents 44dbc13 + 1e279ed commit ee9a2d9

File tree

2 files changed

+0
-85
lines changed

2 files changed

+0
-85
lines changed

src/Entity/ProductCommentCriterion.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ class ProductCommentCriterion
6464
*/
6565
private $active = false;
6666

67-
/**
68-
* @var array
69-
*
70-
* @deprecated 7.0.0 - use criterionLangs instead
71-
*/
72-
private $names;
73-
7467
/**
7568
* @ORM\OneToMany(targetEntity="PrestaShop\Module\ProductComment\Entity\ProductCommentCriterionLang", cascade={"persist", "remove"}, mappedBy="productcommentcriterion")
7669
*/
@@ -136,30 +129,6 @@ public function getCriterionName(): string
136129
return $criterionLang->getName();
137130
}
138131

139-
/**
140-
* @return array
141-
*
142-
* @deprecated 7.0.0 - migrated to Form\ProductCommentCriterionFormDataProvider
143-
*/
144-
public function getNames()
145-
{
146-
return $this->names;
147-
}
148-
149-
/**
150-
* @param array $langNames
151-
*
152-
* @return ProductCommentCriterion
153-
*
154-
* @deprecated 7.0.0
155-
*/
156-
public function setNames($langNames)
157-
{
158-
$this->names = $langNames;
159-
160-
return $this;
161-
}
162-
163132
/**
164133
* @return array
165134
*/

src/Repository/ProductCommentCriterionRepository.php

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ public function remove(ProductCommentCriterion $entity, bool $flush = false): vo
8888
}
8989
}
9090

91-
/**
92-
* @deprecated 7.0.0 - cascade remove by Entity setting instead
93-
*/
94-
private function deleteLangs($criterion): int
95-
{
96-
return $this->connection->executeUpdate('
97-
DELETE FROM `' . _DB_PREFIX_ . 'product_comment_criterion_lang`
98-
WHERE `id_product_comment_criterion` = ' . $criterion->getId());
99-
}
100-
10191
private function deleteCategories($criterion): int
10292
{
10393
return $this->connection->executeUpdate('
@@ -166,34 +156,6 @@ public function update(ProductCommentCriterion $criterion): int
166156
return $res;
167157
}
168158

169-
/**
170-
* @deprecated 7.0.0 - migrated to Form\ProductCommentCriterionFormDataHandler
171-
*/
172-
private function updateLangs($criterion): int
173-
{
174-
$res = 0;
175-
$criterionId = $criterion->getId();
176-
foreach ($criterion->getNames() as $key => $value) {
177-
$qb = $this->connection->createQueryBuilder();
178-
$qb
179-
->insert(_DB_PREFIX_ . 'product_comment_criterion_lang')
180-
->values(
181-
[
182-
'id_product_comment_criterion' => '?',
183-
'id_lang' => '?',
184-
'name' => '?',
185-
]
186-
)
187-
->setParameter(0, $criterionId)
188-
->setParameter(1, $key)
189-
->setParameter(2, $value)
190-
;
191-
$res += $this->connection->executeUpdate($qb->getSQL(), $qb->getParameters(), $qb->getParameterTypes());
192-
}
193-
194-
return $res;
195-
}
196-
197159
private function updateCategories($criterion): int
198160
{
199161
$res = 0;
@@ -342,20 +304,4 @@ public function getTypes()
342304
3 => $sfTranslator->trans('Restricted to some products', [], 'Modules.Productcomments.Admin'),
343305
];
344306
}
345-
346-
/**
347-
* @return ProductCommentCriterion
348-
*
349-
* @deprecated 7.0.0 - use standard find() instead
350-
*/
351-
public function findRelation($id_criterion)
352-
{
353-
if ($id_criterion > 0) {
354-
$criterion = $this->find($id_criterion);
355-
} else {
356-
$criterion = new ProductCommentCriterion();
357-
}
358-
359-
return $criterion;
360-
}
361307
}

0 commit comments

Comments
 (0)