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. * @var int
  111. *
  112. * @ORM\Column(type="integer", options={"default" : 0}, nullable=false)
  113. */
  114. private $expeditionDays;
  115. public function __construct()
  116. {
  117. $this->orderCancellationAllowed = false;
  118. $this->expeditionDays = 0;
  119. }
  120. /**
  121. * @return int
  122. */
  123. public function getId(): int
  124. {
  125. return $this->id;
  126. }
  127. /**
  128. * @param int $id
  129. *
  130. * @return Warehouse
  131. */
  132. public function setId(int $id): self
  133. {
  134. $this->id = $id;
  135. return $this;
  136. }
  137. /**
  138. * @return string
  139. */
  140. public function getName(): string
  141. {
  142. return $this->name;
  143. }
  144. /**
  145. * @param string $name
  146. *
  147. * @return Warehouse
  148. */
  149. public function setName(string $name): self
  150. {
  151. $this->name = $name;
  152. return $this;
  153. }
  154. /**
  155. * @return string
  156. */
  157. public function getReference(): string
  158. {
  159. return $this->reference;
  160. }
  161. /**
  162. * @param string $reference
  163. *
  164. * @return Warehouse
  165. */
  166. public function setReference(string $reference): self
  167. {
  168. $this->reference = $reference;
  169. return $this;
  170. }
  171. /**
  172. * @return string
  173. */
  174. public function getCountry(): string
  175. {
  176. return $this->country;
  177. }
  178. /**
  179. * @param string $country
  180. *
  181. * @return Warehouse
  182. */
  183. public function setCountry(string $country): self
  184. {
  185. $this->country = $country;
  186. return $this;
  187. }
  188. public function isOrderCancellationAllowed(): bool
  189. {
  190. return $this->orderCancellationAllowed;
  191. }
  192. public function setOrderCancellationAllowed(bool $orderCancellationAllowed): Warehouse
  193. {
  194. $this->orderCancellationAllowed = $orderCancellationAllowed;
  195. return $this;
  196. }
  197. public function isAllowFulfillment(): bool
  198. {
  199. return $this->allowFulfillment;
  200. }
  201. public function setAllowFulfillment(bool $allowFulfillment): Warehouse
  202. {
  203. $this->allowFulfillment = $allowFulfillment;
  204. return $this;
  205. }
  206. public function getHolidays(): array
  207. {
  208. return $this->holidays ? \json_decode($this->holidays, true) : [];
  209. }
  210. public function setHolidays(?array $holidays): self
  211. {
  212. $this->holidays = $holidays ? \json_encode($holidays, JSON_THROW_ON_ERROR) : '[]';
  213. return $this;
  214. }
  215. public function getExpeditionDays(): int
  216. {
  217. return $this->expeditionDays;
  218. }
  219. public function setExpeditionDays(int $expeditionDays): Warehouse
  220. {
  221. $this->expeditionDays = $expeditionDays;
  222. return $this;
  223. }
  224. }