src/Entity/ExternalSale.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\ExternalSaleRepository")
  8.  *
  9.  * @UniqueEntity(fields={"provider", "providerId"})
  10.  *
  11.  * @ORM\Table(name="external_sale",
  12.  *     uniqueConstraints={
  13.  *
  14.  *        @ORM\UniqueConstraint(name="provider_id_unique",
  15.  *            columns={"provider", "providerId"})
  16.  *    })
  17.  */
  18. class ExternalSale extends Sale
  19. {
  20.     public const IMPORT_STATUS_PENDING 'pending';
  21.     public const IMPORT_STATUS_RUNNING 'running';
  22.     public const IMPORT_STATUS_DONE 'done';
  23.     public const IMPORT_STATUS_ERROR 'error';
  24.     /**
  25.      * @ORM\Column(type="string")
  26.      *
  27.      * @Assert\NotBlank(groups={"api_rms_saleevent"})
  28.      */
  29.     protected $provider;
  30.     /**
  31.      * @ORM\Column(type="string")
  32.      *
  33.      * @Assert\NotBlank(groups={"api_rms_saleevent"})
  34.      */
  35.     protected $providerId;
  36.     /**
  37.      * @ORM\Column(type="string", nullable=true)
  38.      */
  39.     protected $providerType;
  40.     /**
  41.      * @ORM\Column(type="boolean")
  42.      */
  43.     protected $tracked false;
  44.     /**
  45.      * @ORM\Column(type="string", nullable=true)
  46.      */
  47.     protected $importStatus;
  48.     // transient field
  49.     protected $numberOfVehicles 0;
  50.     /**
  51.      * @ORM\Column(type="boolean")
  52.      */
  53.     protected $endOfSaleProcessed false;
  54.     /**
  55.      * @ORM\Column(type="string", nullable=true)
  56.      */
  57.     protected $originalTitle;
  58.     public function getProvider(): string
  59.     {
  60.         return $this->provider;
  61.     }
  62.     public function setProvider(string $provider): void
  63.     {
  64.         $this->provider $provider;
  65.     }
  66.     public function getProviderId(): string
  67.     {
  68.         return $this->providerId;
  69.     }
  70.     /**
  71.      * Accept null value to use Constraint from Validator.
  72.      */
  73.     public function setProviderId(?string $providerId): void
  74.     {
  75.         $this->providerId $providerId;
  76.     }
  77.     public function getNumberOfVehicles(): int
  78.     {
  79.         return $this->numberOfVehicles;
  80.     }
  81.     public function setNumberOfVehicles(int $numberOfVehicles): void
  82.     {
  83.         $this->numberOfVehicles $numberOfVehicles;
  84.     }
  85.     public function getProviderType(): ?string
  86.     {
  87.         return $this->providerType;
  88.     }
  89.     public function setProviderType(string $providerType): void
  90.     {
  91.         $this->providerType $providerType;
  92.     }
  93.     public function isTracked(): bool
  94.     {
  95.         return $this->tracked;
  96.     }
  97.     public function setTracked(bool $tracked): void
  98.     {
  99.         $this->tracked $tracked;
  100.     }
  101.     public function isEndOfSaleProcessed(): bool
  102.     {
  103.         return $this->endOfSaleProcessed;
  104.     }
  105.     public function setEndOfSaleProcessed(bool $endOfSaleProcessed): void
  106.     {
  107.         $this->endOfSaleProcessed $endOfSaleProcessed;
  108.     }
  109.     public function getImportStatus()
  110.     {
  111.         return $this->importStatus;
  112.     }
  113.     public function setImportStatus($importStatus): void
  114.     {
  115.         $this->importStatus $importStatus;
  116.     }
  117.     public function getOriginalTitle(): ?string
  118.     {
  119.         return $this->originalTitle;
  120.     }
  121.     public function setOriginalTitle(?string $originalTitle): void
  122.     {
  123.         $this->originalTitle $originalTitle;
  124.     }
  125. }