MergeConflictException.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Search\Model\Synonym;
  7. use Magento\Framework\Exception\LocalizedException;
  8. use Magento\Framework\Phrase;
  9. /**
  10. * Exception class for merge conflict during inserting and updating synonym groups
  11. *
  12. * @api
  13. * @since 100.1.0
  14. */
  15. class MergeConflictException extends LocalizedException
  16. {
  17. /**
  18. * Conflicting synonyms
  19. *
  20. * @var array
  21. */
  22. private $conflictingSynonyms;
  23. /**
  24. * Constructor
  25. *
  26. * @param array $conflictingSynonyms
  27. * @param Phrase|null $phrase
  28. * @param \Exception|null $cause
  29. * @param int $code
  30. */
  31. public function __construct(array $conflictingSynonyms, Phrase $phrase = null, \Exception $cause = null, $code = 0)
  32. {
  33. parent::__construct($phrase, $cause, $code);
  34. $this->conflictingSynonyms = $conflictingSynonyms;
  35. }
  36. /**
  37. * Gets conflicting synonyms
  38. *
  39. * @return array
  40. * @since 100.1.0
  41. */
  42. public function getConflictingSynonyms()
  43. {
  44. return $this->conflictingSynonyms;
  45. }
  46. }