<?php
/**
* Created by PhpStorm.
* User: Toni Peral <toniperal.a4b@gmail.com>
* Date: 24/11/20
* Time: 13:04
*/
namespace App\Entity\System;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="ps_service")
*
* @ORM\Entity(repositoryClass="App\Repository\System\ServiceRepository")
*/
class Service
{
public const FTP = 1;
public const SYNCHRONIZED_SHOP = 2;
public const BLOCK_STOCK = 3;
public const WAREHOUSE_PICKUP = 4;
public const API = 5;
public const DROPSHIPPING = 6;
public const PACK_AND_COLLECT = 7;
public const MIP = 8;
public const MIP_PRESTASHOP_360 = 9;
public const MIP_SHOPIFY_360 = 10;
public const MIP_PRESTASHOP = 11;
public const MIP_SHOPIFY = 12;
public const MIP_AMAZON = 13;
public const MIP_EBAY = 14;
public const MIP_GOOGLE_SHOPPING = 15;
public const CREDIT = 16;
public const DOWNLOAD_PRODUCT_LIST = 17;
public const MIP_ALIEXPRESS = 18;
public const MIP_CDISCOUNT = 19;
public const MIP_WOOCOMMERCE = 20;
public const MIP_MAGENTO = 21;
public const MIP_RAKUTEN = 22;
public const MIP_CARREFOUR = 23;
public const MIP_FNAC = 24;
public const MIP_GROUPON = 25;
public const MIP_EPRICE = 26;
public const MIP_FACEBOOK = 27;
public const MIP_DARTY = 28;
public const MIP_RUE_DU_COMMERCE = 29;
public const MIP_CONFORAMA = 30;
public const MIP_VIDAXL = 31;
public const MIP_REAL = 32;
public const MIP_BOLCOM = 33;
public const MIP_VENCA = 34;
public const MIP_TRADEMAX = 35;
public const MIP_SPRINTER = 36;
public const MIP_PC_COMPONENTES = 37;
public const MIP_5xMARKETPLACES = 38;
public const MIP_ALLEGRO = 39;
public const MIP_WORTEN = 42;
public const FBA_ALLOWED = 43;
public const MIP_MEDIAMARKT_ES = 43;
public const MIP_LEROY_MERLIN = 45;
public const MIP_WIX = 46;
public const EXTRA_DISCOUNT = 47;
public const ORDERS_BY_CSV = 48;
public const MIP_CDON = 49;
public const MIP_WISH = 50;
public const MIP_CARREFOUR_FR = 52;
public const MIP_ELECLERC = 53;
public const MIP_PERFUMES_CLUB = 54;
public const MIP_MIRAVIA = 55;
public const MIP_MEDIAMARKT_DE = 56;
public const SERVICE_API_TEXT = 'API';
public const SHOPS_SERVICES_IDS = [self::MIP_PRESTASHOP_360, self::MIP_SHOPIFY_360];
public const ADMIN_SERVICES_OPTION = [
'Bloqueo de stock' => self::BLOCK_STOCK,
'Recoger en almacén' => self::WAREHOUSE_PICKUP,
'Descarga de csv' => self::DOWNLOAD_PRODUCT_LIST,
'Dropshipping' => self::DROPSHIPPING,
'Crédito' => self::CREDIT,
'Permitir FBA' => self::FBA_ALLOWED,
'Extra discount' => self::EXTRA_DISCOUNT,
];
/**
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*
* @ORM\Column(name="id_service", type="integer")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=32)
*/
private $name;
/**
* @var string|null
*
* @ORM\Column(type="string", length=32, nullable=true)
*/
private $key;
/**
* @var bool
*
* @ORM\Column(type="boolean", columnDefinition="tinyint(4)")
*/
private $unique;
/**
* @var ServiceCustomer
*
* @ORM\OneToMany(targetEntity="App\Entity\System\ServiceCustomer", mappedBy="service", cascade={"persist"})
*/
private $serviceCustomer;
public function __construct()
{
$this->serviceCustomer = new ArrayCollection();
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*
* @return Service
*/
public function setId($id): Service
{
$this->id = $id;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $name
*
* @return Service
*/
public function setName(string $name): Service
{
$this->name = $name;
return $this;
}
/**
* @return string|null
*/
public function getKey(): ?string
{
return $this->key;
}
/**
* @param string|null $key
*
* @return Service
*/
public function setKey(?string $key): Service
{
$this->key = $key;
return $this;
}
/**
* @return bool
*/
public function isUnique(): bool
{
return $this->unique;
}
/**
* @param bool $unique
*
* @return Service
*/
public function setUnique(bool $unique): Service
{
$this->unique = $unique;
return $this;
}
/**
* @return ServiceCustomer
*/
public function getServiceCustomer(): ServiceCustomer
{
return $this->serviceCustomer;
}
/**
* @param ServiceCustomer $serviceCustomer
*
* @return Service
*/
public function setServiceCustomer(ServiceCustomer $serviceCustomer): Service
{
$this->serviceCustomer = $serviceCustomer;
return $this;
}
}