選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

SectionSettingDefinition.php 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Lc\CaracoleBundle\Definition;
  3. use Lc\SovBundle\Definition\AbstractSettingDefinition;
  4. class SectionSettingDefinition extends AbstractSettingDefinition
  5. {
  6. const CATEGORY_GENERAL = 'general';
  7. const SETTING_REFERENCE_PREFIX = 'orderReferencePrefix';
  8. const SETTING_ORDER_STATE = 'orderState';
  9. const SETTING_ORDER_CLOSED_START = 'orderClosedStart';
  10. const SETTING_ORDER_CLOSED_END = 'orderClosedEnd';
  11. const SETTING_ORDER_MAXIMUM_PER_CYCLE = 'orderMaximumPerCycle';
  12. const VALUE_ORDER_STATE_DEFAULT = 'default';
  13. const VALUE_ORDER_STATE_OPEN = 'open';
  14. const VALUE_ORDER_STATE_CLOSED = 'closed';
  15. public function __construct()
  16. {
  17. $this->addSettingText(
  18. [
  19. 'name' => self::SETTING_REFERENCE_PREFIX,
  20. 'category' => self::CATEGORY_GENERAL,
  21. ]
  22. );
  23. $this->addSettingSelect(
  24. [
  25. 'name' => self::SETTING_ORDER_STATE,
  26. 'category' => self::CATEGORY_GENERAL,
  27. 'choices' => [
  28. 'Suivant configuration ouvertures' => self::VALUE_ORDER_STATE_DEFAULT,
  29. 'Ouvertes' => self::VALUE_ORDER_STATE_OPEN,
  30. 'Fermées' => self::VALUE_ORDER_STATE_CLOSED,
  31. ],
  32. 'default' => self::VALUE_ORDER_STATE_DEFAULT
  33. ]
  34. );
  35. $this->addSettingDate(
  36. [
  37. 'name' => self::SETTING_ORDER_CLOSED_START,
  38. 'category' => self::CATEGORY_GENERAL,
  39. ]
  40. );
  41. $this->addSettingDate(
  42. [
  43. 'name' => self::SETTING_ORDER_CLOSED_END,
  44. 'category' => self::CATEGORY_GENERAL,
  45. ]
  46. );
  47. $this->addSettingText(
  48. [
  49. 'name' => self::SETTING_ORDER_MAXIMUM_PER_CYCLE,
  50. 'category' => self::CATEGORY_GENERAL,
  51. ]
  52. );
  53. }
  54. public function getCategories()
  55. {
  56. return [
  57. self::CATEGORY_GENERAL,
  58. ];
  59. }
  60. }