Skip to content

Commit

Permalink
PISHPS-304: OrderTagService now searches the tag by name
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muxfeld-diw committed Sep 4, 2024
1 parent 501da35 commit b02199e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Service/Tags/OrderTagService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ public function addTagToSubscriptionOrder(SubscriptionEntity $entity, Context $c
throw CouldNotTagOrderException::forSubscription(sprintf('Order with ID "%s" not found', $orderId));
}

// Fetch or create the tag
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('id', $subscriptionTag->getId()));
$criteria->addFilter(new EqualsFilter('name', $subscriptionTag->getName()));
/** @var null|TagEntity $tag */
$tag = $this->tagRepository->search($criteria, $context)->first();

Expand Down Expand Up @@ -88,6 +87,6 @@ public function addTagToSubscriptionOrder(SubscriptionEntity $entity, Context $c
*/
private function serializeTag(TagEntity $tag): array
{
return ['id' => $tag->getId(),];
return ['id' => $tag->getId()];
}
}

0 comments on commit b02199e

Please sign in to comment.