src/Entity/System/Service.php line 19

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