Config.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\SalesSequence\Model;
  7. /**
  8. * Class Config - configuration container for sequence
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Config
  14. {
  15. /**
  16. * Default sequence values
  17. * Prefix represents prefix for sequence: AA000
  18. * Suffix represents suffix: 000AA
  19. * startValue represents initial value
  20. * warning value will be using for alert messages when increment closing to overflow
  21. * maxValue represents last available increment id in system
  22. *
  23. * @var array
  24. */
  25. protected $defaultValues = [
  26. 'prefix' => '',
  27. 'suffix' => '',
  28. 'startValue' => 1,
  29. 'step' => 1,
  30. 'warningValue' => 4294966295,
  31. 'maxValue' => 4294967295
  32. ];
  33. /**
  34. * Get configuration field
  35. *
  36. * @param string|null $key
  37. * @return mixed
  38. */
  39. public function get($key = null)
  40. {
  41. if (!array_key_exists($key, $this->defaultValues)) {
  42. return null;
  43. }
  44. return $this->defaultValues[$key];
  45. }
  46. }