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 SERVICE_API_TEXT = 'API';
  79. public const SHOPS_SERVICES_IDS = [self::MIP_PRESTASHOP_360, self::MIP_SHOPIFY_360];
  80. public const SERVICES_IN_5x_CONNECTORS = [
  81. self::MIP_CDISCOUNT,
  82. self::MIP_RAKUTEN,
  83. self::MIP_DARTY,
  84. self::MIP_RUE_DU_COMMERCE,
  85. self::MIP_CONFORAMA,
  86. ];
  87. public const ADMIN_SERVICES_OPTION = [
  88. 'Recoger en almacén' => self::WAREHOUSE_PICKUP,
  89. 'Crédito' => self::CREDIT,
  90. 'Permitir FBA' => self::FBA_ALLOWED,
  91. 'Extra discount' => self::EXTRA_DISCOUNT,
  92. ];
  93. public const AVAILABLE_PACK_SERVICE_IDS_GROUPED_BY_PACK_ID = [
  94. Pack::PACK_B2B => [
  95. ],
  96. Pack::PACK_ECOMMERCE => [
  97. Service::FTP,
  98. Service::API,
  99. Service::DROPSHIPPING,
  100. Service::MIP,
  101. Service::DOWNLOAD_PRODUCT_LIST,
  102. Service::ORDERS_BY_CSV,
  103. ],
  104. Pack::PACK_MARKETPLACES => [
  105. Service::FTP,
  106. Service::API,
  107. Service::DROPSHIPPING,
  108. Service::MIP,
  109. Service::DOWNLOAD_PRODUCT_LIST,
  110. Service::ORDERS_BY_CSV,
  111. ],
  112. ];
  113. /**
  114. * @ORM\Id
  115. *
  116. * @ORM\GeneratedValue(strategy="AUTO")
  117. *
  118. * @ORM\Column(name="id_service", type="integer")
  119. */
  120. private $id;
  121. /**
  122. * @var string
  123. *
  124. * @ORM\Column(type="string", length=32)
  125. */
  126. private $name;
  127. /**
  128. * @var string|null
  129. *
  130. * @ORM\Column(type="string", name="`key`", length=32, nullable=true)
  131. */
  132. private $key;
  133. /**
  134. * @var bool
  135. *
  136. * @ORM\Column(type="boolean", name="`unique`")
  137. */
  138. private $unique;
  139. /**
  140. * @var ServiceCustomer
  141. *
  142. * @ORM\OneToMany(targetEntity="App\Entity\System\ServiceCustomer", mappedBy="service", cascade={"persist"})
  143. */
  144. private $serviceCustomer;
  145. public function __construct()
  146. {
  147. $this->serviceCustomer = new ArrayCollection();
  148. }
  149. /**
  150. * @return mixed
  151. */
  152. public function getId()
  153. {
  154. return $this->id;
  155. }
  156. /**
  157. * @param mixed $id
  158. *
  159. * @return Service
  160. */
  161. public function setId($id): Service
  162. {
  163. $this->id = $id;
  164. return $this;
  165. }
  166. /**
  167. * @return string
  168. */
  169. public function getName(): string
  170. {
  171. return $this->name;
  172. }
  173. /**
  174. * @param string $name
  175. *
  176. * @return Service
  177. */
  178. public function setName(string $name): Service
  179. {
  180. $this->name = $name;
  181. return $this;
  182. }
  183. /**
  184. * @return string|null
  185. */
  186. public function getKey(): ?string
  187. {
  188. return $this->key;
  189. }
  190. /**
  191. * @param string|null $key
  192. *
  193. * @return Service
  194. */
  195. public function setKey(?string $key): Service
  196. {
  197. $this->key = $key;
  198. return $this;
  199. }
  200. /**
  201. * @return bool
  202. */
  203. public function isUnique(): bool
  204. {
  205. return $this->unique;
  206. }
  207. /**
  208. * @param bool $unique
  209. *
  210. * @return Service
  211. */
  212. public function setUnique(bool $unique): Service
  213. {
  214. $this->unique = $unique;
  215. return $this;
  216. }
  217. /**
  218. * @return ServiceCustomer
  219. */
  220. public function getServiceCustomer(): ServiceCustomer
  221. {
  222. return $this->serviceCustomer;
  223. }
  224. /**
  225. * @param ServiceCustomer $serviceCustomer
  226. *
  227. * @return Service
  228. */
  229. public function setServiceCustomer(ServiceCustomer $serviceCustomer): Service
  230. {
  231. $this->serviceCustomer = $serviceCustomer;
  232. return $this;
  233. }
  234. }