src/Entity/System/Warehouse.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Warehouse
  6. *
  7. * @ORM\Table(name="ps_warehouse")
  8. *
  9. * @ORM\Entity(repositoryClass="App\Repository\System\WarehouseRepository")
  10. */
  11. class Warehouse
  12. {
  13. public const DEFAULT_WAREHOUSE_ID = 1;
  14. public const TELLMEGEN_WAREHOUSE_ID = 2;
  15. public const FR_001 = 3; // S71 Octopia
  16. public const ES_003 = 4; // S74 tyres
  17. public const IT_001 = 5; // S72 watches
  18. public const CZ_001 = 6; // S83 Parfums 2
  19. public const PL_001 = 7; // S91 informatica 4
  20. public const ES_004 = 8; // D06 Jamones Linaje negro
  21. public const ES_005 = 9; // D13 Zapatillas Timpers
  22. public const NL_001 = 10; // S94
  23. public const ES_006 = 11; // D07 Soportes Meollo
  24. public const ES_007 = 12; // LG
  25. public const ES_008 = 13; // M01 Perfumes 5
  26. public const ES_009 = 14; // D20
  27. public const DE_001 = 15; // M02
  28. public const ES_010 = 16; // M06
  29. public const ES_011 = 17; // M08
  30. public const ES_012 = 18; // M07
  31. public const ES_013 = 19; // M10_PAE_2 Aigostar
  32. public const ES_015 = 20;
  33. public const ES_016 = 21; // 2core
  34. public const ES_014 = 22; // M12
  35. public const CN_001 = 23; // D25 - Kerry
  36. public const ES_017 = 24; // M13
  37. public const REFERENCES_INDEXED_BY_ID = [
  38. self::DEFAULT_WAREHOUSE_ID => 'ES_001',
  39. self::TELLMEGEN_WAREHOUSE_ID => 'ES_002',
  40. self::FR_001 => 'FR_001',
  41. self::ES_003 => 'ES_003',
  42. self::IT_001 => 'IT_001',
  43. self::CZ_001 => 'CZ_001',
  44. self::PL_001 => 'PL_001',
  45. self::ES_004 => 'ES_004',
  46. self::ES_005 => 'ES_005',
  47. self::ES_006 => 'ES_006',
  48. self::ES_007 => 'ES_007',
  49. self::ES_008 => 'ES_008',
  50. self::ES_009 => 'ES_009',
  51. self::DE_001 => 'DE_001',
  52. self::NL_001 => 'NL_001',
  53. self::ES_010 => 'ES_010',
  54. self::ES_011 => 'ES_011',
  55. self::ES_012 => 'ES_012',
  56. self::ES_013 => 'ES_013',
  57. self::ES_015 => 'ES_015',
  58. self::ES_016 => 'ES_016',
  59. self::ES_014 => 'ES_014',
  60. self::CN_001 => 'CN_001',
  61. self::ES_017 => 'ES_017',
  62. ];
  63. /**
  64. * @var int
  65. *
  66. * @ORM\Column(name="id", type="integer")
  67. *
  68. * @ORM\Id
  69. *
  70. * @ORM\GeneratedValue(strategy="AUTO")
  71. */
  72. private $id;
  73. /**
  74. * @var string
  75. *
  76. * @ORM\Column(type="string", length=100)
  77. */
  78. private $name;
  79. /**
  80. * @var string
  81. *
  82. * @ORM\Column(type="string")
  83. */
  84. private $reference;
  85. /**
  86. * @var string
  87. *
  88. * @ORM\Column(type="string", length=2)
  89. */
  90. private $country;
  91. /**
  92. * @var bool
  93. *
  94. * @ORM\Column(type="boolean", options={"default": 0})
  95. */
  96. private $orderCancellationAllowed;
  97. /**
  98. * @var bool
  99. *
  100. * @ORM\Column(type="boolean", options={"default": 0})
  101. */
  102. private $allowFulfillment = false;
  103. /**
  104. * @var string|null
  105. *
  106. * @ORM\Column(type="text" ,nullable=true)
  107. */
  108. private $holidays;
  109. /**
  110. * @return int
  111. */
  112. public function getId(): int
  113. {
  114. return $this->id;
  115. }
  116. /**
  117. * @param int $id
  118. *
  119. * @return Warehouse
  120. */
  121. public function setId(int $id): self
  122. {
  123. $this->id = $id;
  124. return $this;
  125. }
  126. /**
  127. * @return string
  128. */
  129. public function getName(): string
  130. {
  131. return $this->name;
  132. }
  133. /**
  134. * @param string $name
  135. *
  136. * @return Warehouse
  137. */
  138. public function setName(string $name): self
  139. {
  140. $this->name = $name;
  141. return $this;
  142. }
  143. /**
  144. * @return string
  145. */
  146. public function getReference(): string
  147. {
  148. return $this->reference;
  149. }
  150. /**
  151. * @param string $reference
  152. *
  153. * @return Warehouse
  154. */
  155. public function setReference(string $reference): self
  156. {
  157. $this->reference = $reference;
  158. return $this;
  159. }
  160. /**
  161. * @return string
  162. */
  163. public function getCountry(): string
  164. {
  165. return $this->country;
  166. }
  167. /**
  168. * @param string $country
  169. *
  170. * @return Warehouse
  171. */
  172. public function setCountry(string $country): self
  173. {
  174. $this->country = $country;
  175. return $this;
  176. }
  177. public function isOrderCancellationAllowed(): bool
  178. {
  179. return $this->orderCancellationAllowed;
  180. }
  181. public function setOrderCancellationAllowed(bool $orderCancellationAllowed): Warehouse
  182. {
  183. $this->orderCancellationAllowed = $orderCancellationAllowed;
  184. return $this;
  185. }
  186. public function isAllowFulfillment(): bool
  187. {
  188. return $this->allowFulfillment;
  189. }
  190. public function setAllowFulfillment(bool $allowFulfillment): Warehouse
  191. {
  192. $this->allowFulfillment = $allowFulfillment;
  193. return $this;
  194. }
  195. public function getHolidays(): array
  196. {
  197. return $this->holidays ? \json_decode($this->holidays, true) : [];
  198. }
  199. public function setHolidays(?array $holidays): self
  200. {
  201. $this->holidays = $holidays ? \json_encode($holidays, JSON_THROW_ON_ERROR) : '[]';
  202. return $this;
  203. }
  204. }