You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.7KB

  1. <?php
  2. namespace domain\Config\Unit;
  3. use domain\_\AbstractDefinition;
  4. class UnitDefinition extends AbstractDefinition
  5. {
  6. const UNIT_PIECE = 'PIECE';
  7. const UNIT_G = 'g';
  8. const UNIT_KG = 'kg';
  9. const UNIT_ML = 'mL';
  10. const UNIT_L = 'L';
  11. const WORDING_UNIT = 'wording_unit';
  12. const WORDING = 'wording';
  13. const WORDING_SHORT = 'wording_short';
  14. public function getUnits(): array
  15. {
  16. return [
  17. 'piece' => [
  18. 'unit' => 'piece',
  19. 'wording_unit' => 'la pièce',
  20. 'wording' => 'pièce(s)',
  21. 'wording_short' => 'p.',
  22. 'coefficient' => 1
  23. ],
  24. 'g' => [
  25. 'ref_unit' => 'kg',
  26. 'unit' => 'g',
  27. 'wording_unit' => 'le g',
  28. 'wording' => 'g',
  29. 'wording_short' => 'g',
  30. 'coefficient' => 1000
  31. ],
  32. 'kg' => [
  33. 'unit' => 'kg',
  34. 'wording_unit' => 'le kg',
  35. 'wording' => 'kg',
  36. 'wording_short' => 'kg',
  37. 'coefficient' => 1
  38. ],
  39. 'mL' => [
  40. 'ref_unit' => 'L',
  41. 'unit' => 'mL',
  42. 'wording_unit' => 'le mL',
  43. 'wording' => 'mL',
  44. 'wording_short' => 'mL',
  45. 'coefficient' => 1000
  46. ],
  47. 'L' => [
  48. 'unit' => 'L',
  49. 'wording_unit' => 'le litre',
  50. 'wording' => 'L',
  51. 'wording_short' => 'L',
  52. 'coefficient' => 1
  53. ],
  54. ];
  55. }
  56. public function getEntityFqcn(): string
  57. {
  58. return '';
  59. }
  60. }