<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass="App\Repository\ExternalSaleRepository")
*
* @UniqueEntity(fields={"provider", "providerId"})
*
* @ORM\Table(name="external_sale",
* uniqueConstraints={
*
* @ORM\UniqueConstraint(name="provider_id_unique",
* columns={"provider", "providerId"})
* })
*/
class ExternalSale extends Sale
{
public const IMPORT_STATUS_PENDING = 'pending';
public const IMPORT_STATUS_RUNNING = 'running';
public const IMPORT_STATUS_DONE = 'done';
public const IMPORT_STATUS_ERROR = 'error';
/**
* @ORM\Column(type="string")
*
* @Assert\NotBlank(groups={"api_rms_saleevent"})
*/
protected $provider;
/**
* @ORM\Column(type="string")
*
* @Assert\NotBlank(groups={"api_rms_saleevent"})
*/
protected $providerId;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $providerType;
/**
* @ORM\Column(type="boolean")
*/
protected $tracked = false;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $importStatus;
// transient field
protected $numberOfVehicles = 0;
/**
* @ORM\Column(type="boolean")
*/
protected $endOfSaleProcessed = false;
/**
* @ORM\Column(type="string", nullable=true)
*/
protected $originalTitle;
public function getProvider(): string
{
return $this->provider;
}
public function setProvider(string $provider): void
{
$this->provider = $provider;
}
public function getProviderId(): string
{
return $this->providerId;
}
/**
* Accept null value to use Constraint from Validator.
*/
public function setProviderId(?string $providerId): void
{
$this->providerId = $providerId;
}
public function getNumberOfVehicles(): int
{
return $this->numberOfVehicles;
}
public function setNumberOfVehicles(int $numberOfVehicles): void
{
$this->numberOfVehicles = $numberOfVehicles;
}
public function getProviderType(): ?string
{
return $this->providerType;
}
public function setProviderType(string $providerType): void
{
$this->providerType = $providerType;
}
public function isTracked(): bool
{
return $this->tracked;
}
public function setTracked(bool $tracked): void
{
$this->tracked = $tracked;
}
public function isEndOfSaleProcessed(): bool
{
return $this->endOfSaleProcessed;
}
public function setEndOfSaleProcessed(bool $endOfSaleProcessed): void
{
$this->endOfSaleProcessed = $endOfSaleProcessed;
}
public function getImportStatus()
{
return $this->importStatus;
}
public function setImportStatus($importStatus): void
{
$this->importStatus = $importStatus;
}
public function getOriginalTitle(): ?string
{
return $this->originalTitle;
}
public function setOriginalTitle(?string $originalTitle): void
{
$this->originalTitle = $originalTitle;
}
}