src/Entity/System/Service.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Toni Peral <[email protected]>
  5. * Date: 24/11/20
  6. * Time: 13:04
  7. */
  8. namespace App\Entity\System;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12. * @ORM\Table(name="ps_service")
  13. *
  14. * @ORM\Entity(repositoryClass="App\Repository\System\ServiceRepository")
  15. */
  16. class Service
  17. {
  18. public const FTP = 1;
  19. public const SYNCHRONIZED_SHOP = 2;
  20. public const BLOCK_STOCK = 3;
  21. public const WAREHOUSE_PICKUP = 4;
  22. public const API = 5;
  23. public const DROPSHIPPING = 6;
  24. public const PACK_AND_COLLECT = 7;
  25. public const MIP = 8;
  26. public const MIP_PRESTASHOP_360 = 9;
  27. public const MIP_SHOPIFY_360 = 10;
  28. public const MIP_PRESTASHOP = 11;
  29. public const MIP_SHOPIFY = 12;
  30. public const MIP_AMAZON = 13;
  31. public const MIP_EBAY = 14;
  32. public const MIP_GOOGLE_SHOPPING = 15;
  33. public const CREDIT = 16;
  34. public const DOWNLOAD_PRODUCT_LIST = 17;
  35. public const MIP_ALIEXPRESS = 18;
  36. public const MIP_CDISCOUNT = 19;
  37. public const MIP_WOOCOMMERCE = 20;
  38. public const MIP_MAGENTO = 21;
  39. public const MIP_RAKUTEN = 22;
  40. public const MIP_CARREFOUR = 23;
  41. public const MIP_FNAC = 24;
  42. public const MIP_GROUPON = 25;
  43. public const MIP_EPRICE = 26;
  44. public const MIP_FACEBOOK = 27;
  45. public const MIP_DARTY = 28;
  46. public const MIP_RUE_DU_COMMERCE = 29;
  47. public const MIP_CONFORAMA = 30;
  48. public const MIP_VIDAXL = 31;
  49. public const MIP_REAL = 32;
  50. public const MIP_BOLCOM = 33;
  51. public const MIP_VENCA = 34;
  52. public const MIP_TRADEMAX = 35;
  53. public const MIP_SPRINTER = 36;
  54. public const MIP_PC_COMPONENTES = 37;
  55. public const MIP_5xMARKETPLACES = 38;
  56. public const MIP_ALLEGRO = 39;
  57. public const MIP_MAKRO = 40;
  58. public const MIP_SHOWROOM_PRIVE_FR = 41;
  59. public const MIP_WORTEN = 42;
  60. public const FBA_ALLOWED = 43;
  61. public const MIP_MEDIAMARKT_ES = 44;
  62. public const MIP_LEROY_MERLIN = 45;
  63. public const MIP_WIX = 46;
  64. public const EXTRA_DISCOUNT = 47;
  65. public const ORDERS_BY_CSV = 48;
  66. public const MIP_CDON = 49;
  67. public const MIP_WISH = 50;
  68. public const MIP_BACKMARKET = 51;
  69. public const MIP_CARREFOUR_FR = 52;
  70. public const MIP_ELECLERC = 53;
  71. public const MIP_PERFUMES_CLUB = 54;
  72. public const MIP_MIRAVIA = 55;
  73. public const MIP_MEDIAMARKT_DE = 56;
  74. public const MIP_MEDIAMARKT_IT = 57;
  75. public const MIP_MANOMANO = 58;
  76. public const MIP_REFURBED = 59;
  77. public const MIP_CLUBEFASHION = 60;
  78. public const MIP_DECATHLON = 61;
  79. public const SERVICE_API_TEXT = 'API';
  80. public const SHOPS_SERVICES_IDS = [self::MIP_PRESTASHOP_360, self::MIP_SHOPIFY_360];
  81. public const SERVICES_IN_5x_CONNECTORS = [
  82. self::MIP_CDISCOUNT,
  83. self::MIP_RAKUTEN,
  84. self::MIP_DARTY,
  85. self::MIP_RUE_DU_COMMERCE,
  86. self::MIP_CONFORAMA,
  87. ];
  88. public const ADMIN_SERVICES_OPTION = [
  89. 'Recoger en almacén' => self::WAREHOUSE_PICKUP,
  90. 'Crédito' => self::CREDIT,
  91. 'Permitir FBA' => self::FBA_ALLOWED,
  92. 'Extra discount' => self::EXTRA_DISCOUNT,
  93. ];
  94. public const AVAILABLE_PACK_SERVICE_IDS_GROUPED_BY_PACK_ID = [
  95. Pack::PACK_B2B => [
  96. ],
  97. Pack::PACK_ECOMMERCE => [
  98. Service::FTP,
  99. Service::API,
  100. Service::DROPSHIPPING,
  101. Service::MIP,
  102. Service::DOWNLOAD_PRODUCT_LIST,
  103. Service::ORDERS_BY_CSV,
  104. ],
  105. Pack::PACK_MARKETPLACES => [
  106. Service::FTP,
  107. Service::API,
  108. Service::DROPSHIPPING,
  109. Service::MIP,
  110. Service::DOWNLOAD_PRODUCT_LIST,
  111. Service::ORDERS_BY_CSV,
  112. ],
  113. ];
  114. /**
  115. * @ORM\Id
  116. *
  117. * @ORM\GeneratedValue(strategy="AUTO")
  118. *
  119. * @ORM\Column(name="id_service", type="integer")
  120. */
  121. private $id;
  122. /**
  123. * @var string
  124. *
  125. * @ORM\Column(type="string", length=32)
  126. */
  127. private $name;
  128. /**
  129. * @var string|null
  130. *
  131. * @ORM\Column(type="string", name="`key`", length=32, nullable=true)
  132. */
  133. private $key;
  134. /**
  135. * @var bool
  136. *
  137. * @ORM\Column(type="boolean", name="`unique`")
  138. */
  139. private $unique;
  140. /**
  141. * @var ServiceCustomer
  142. *
  143. * @ORM\OneToMany(targetEntity="App\Entity\System\ServiceCustomer", mappedBy="service", cascade={"persist"})
  144. */
  145. private $serviceCustomer;
  146. public function __construct()
  147. {
  148. $this->serviceCustomer = new ArrayCollection();
  149. }
  150. /**
  151. * @return mixed
  152. */
  153. public function getId()
  154. {
  155. return $this->id;
  156. }
  157. /**
  158. * @param mixed $id
  159. *
  160. * @return Service
  161. */
  162. public function setId($id): Service
  163. {
  164. $this->id = $id;
  165. return $this;
  166. }
  167. /**
  168. * @return string
  169. */
  170. public function getName(): string
  171. {
  172. return $this->name;
  173. }
  174. /**
  175. * @param string $name
  176. *
  177. * @return Service
  178. */
  179. public function setName(string $name): Service
  180. {
  181. $this->name = $name;
  182. return $this;
  183. }
  184. /**
  185. * @return string|null
  186. */
  187. public function getKey(): ?string
  188. {
  189. return $this->key;
  190. }
  191. /**
  192. * @param string|null $key
  193. *
  194. * @return Service
  195. */
  196. public function setKey(?string $key): Service
  197. {
  198. $this->key = $key;
  199. return $this;
  200. }
  201. /**
  202. * @return bool
  203. */
  204. public function isUnique(): bool
  205. {
  206. return $this->unique;
  207. }
  208. /**
  209. * @param bool $unique
  210. *
  211. * @return Service
  212. */
  213. public function setUnique(bool $unique): Service
  214. {
  215. $this->unique = $unique;
  216. return $this;
  217. }
  218. /**
  219. * @return ServiceCustomer
  220. */
  221. public function getServiceCustomer(): ServiceCustomer
  222. {
  223. return $this->serviceCustomer;
  224. }
  225. /**
  226. * @param ServiceCustomer $serviceCustomer
  227. *
  228. * @return Service
  229. */
  230. public function setServiceCustomer(ServiceCustomer $serviceCustomer): Service
  231. {
  232. $this->serviceCustomer = $serviceCustomer;
  233. return $this;
  234. }
  235. }