Skip to content

Commit

Permalink
Update parameter on delete custom entity
Browse files Browse the repository at this point in the history
  • Loading branch information
cemag44 authored and cemag44300 committed Jan 30, 2023
1 parent f2341e4 commit f6b291f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## [1.3.9] - 2023-01-30
[1.3.9]: https://github.com/Smile-SA/magento2-module-custom-entity/compare/1.3.8...1.3.9

- Update parameter on delete custom entity

## [1.3.8] - 2022-12-02
[1.3.8]: https://github.com/Smile-SA/magento2-module-custom-entity/compare/1.3.7...1.3.8

Expand Down
5 changes: 2 additions & 3 deletions Model/CustomEntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,12 @@ public function get($entityId, ?int $storeId = null, bool $forceReload = false):
public function delete(CustomEntityInterface $entity): bool
{
try {
$entityId = $entity->getId();
$this->customEntityResource->delete($entityId);
$this->customEntityResource->delete($entity);
} catch (\Exception $e) {
throw new StateException(__('Cannot delete entity with id %1', $entity->getId()), $e);
}

unset($this->instances[$entityId]);
unset($this->instances[$entity->getId()]);

return true;
}
Expand Down

0 comments on commit f6b291f

Please sign in to comment.