<?php
namespace App\V4\Model\QuoteState;
use ApiPlatform\Core\Annotation\ApiProperty;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Model\IriNormalizableInterface;
use App\Model\NormalizeAsIRITrait;
use App\Model\Traits\ImportableObjectTrait;
use App\V4\Model\QuoteReason\QuoteReason;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource(
* attributes={
* "denormalization_context": {
* "api_allow_update": true
* }
* },
* collectionOperations={
* "get": {
* "normalization_context": {
* "groups": {"quote_state:list"},
* "enable_max_depth": true
* },
* "security": "is_granted(constant('App\\V4\\Voters\\QuoteVoter::QUOTE_STATE_ADD_EDIT'), 'App\V4\Voters\QuoteVoter')"
* }
* },
* itemOperations={
* },
* )
*/
class QuoteState implements IriNormalizableInterface
{
use ImportableObjectTrait;
use NormalizeAsIRITrait;
/**
* @ApiProperty(identifier=true)
*
* @var string|null
* @Groups({
* "quote_state:list", "quote_state:read",
* "quote:list", "quote:read"
* })
*/
private $id;
/**
* @var string|null
*
* @ORM\Column(type="string", length=255)
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $name;
/**
* @var bool|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $inProgress;
/**
* @var bool|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isWon;
/**
* @var bool|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isLost;
/**
* @var bool|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isAbandoned;
/**
* @var bool|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isUnSelectable;
/**
* @var bool
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isDiffered = false;
/**
* @var bool
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $isNotCountForStats = false;
/**
* @var string|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $externalId;
/**
* @var string|null
*
* @Groups({
* "quote_state:list",
* "quote:list", "quote:read"
* })
*/
private $order;
/**
* @var bool
*/
private $fromForm = false;
/**
* @var QuoteReason[]|Collection
* @Groups({
* "quote_state:list", "quote_state:read",
* "quote:list", "quote:read"
* })
*/
private $reasons;
public function __construct()
{
$this->reasons = new ArrayCollection();
}
/**
* @return string|null
*/
public function getId(): ?string
{
return $this->id;
}
/**
* @param string|null $id
*
* @return QuoteState
*/
public function setId(?string $id): QuoteState
{
$this->id = $id;
return $this;
}
/**
* @return string|null
*/
public function getName(): ?string
{
return $this->name;
}
/**
* @param string|null $name
*
* @return QuoteState
*/
public function setName(?string $name): QuoteState
{
$this->name = $name;
return $this;
}
/**
* @return bool|null
*/
public function getIsWon(): ?bool
{
return $this->isWon;
}
/**
* @param bool|null $isWon
*
* @return QuoteState
*/
public function setIsWon(?bool $isWon): QuoteState
{
$this->isWon = $isWon;
return $this;
}
/**
* @return string|null
*/
public function getExternalId(): ?string
{
return $this->externalId;
}
/**
* @param string|null $externalId
*
* @return QuoteState
*/
public function setExternalId(?string $externalId): QuoteState
{
$this->externalId = $externalId;
return $this;
}
/**
* @return string|null
*/
public function getOrder(): ?string
{
return $this->order;
}
/**
* @param string|null $order
*
* @return QuoteState
*/
public function setOrder(?string $order): QuoteState
{
$this->order = $order;
return $this;
}
/**
* @return string
*/
public function __toString(): string
{
return $this->getId();
}
/**
* @return bool
*/
public function isFromForm(): bool
{
return $this->fromForm;
}
/**
* @param bool $fromForm
*
* @return QuoteState
*/
public function setFromForm(bool $fromForm): QuoteState
{
$this->fromForm = $fromForm;
return $this;
}
/**
* @return bool|null
*/
public function getInProgress(): ?bool
{
return $this->inProgress;
}
/**
* @param bool|null $inProgress
*
* @return QuoteState
*/
public function setInProgress(?bool $inProgress): QuoteState
{
$this->inProgress = $inProgress;
return $this;
}
/**
* @return bool|null
*/
public function getIsLost(): ?bool
{
return $this->isLost;
}
/**
* @param bool|null $isLost
*
* @return QuoteState
*/
public function setIsLost(?bool $isLost): QuoteState
{
$this->isLost = $isLost;
return $this;
}
/**
* @return bool|null
*/
public function getIsAbandoned(): ?bool
{
return $this->isAbandoned;
}
/**
* @param bool|null $isAbandoned
*
* @return QuoteState
*/
public function setIsAbandoned(?bool $isAbandoned): QuoteState
{
$this->isAbandoned = $isAbandoned;
return $this;
}
/**
* @return bool|null
*/
public function getIsUnSelectable(): ?bool
{
return $this->isUnSelectable;
}
/**
* @param bool|null $isUnSelectable
*
* @return QuoteState
*/
public function setIsUnSelectable(?bool $isUnSelectable): self
{
$this->isUnSelectable = $isUnSelectable;
return $this;
}
/**
* @return bool|null
*/
public function getIsDiffered(): bool
{
return $this->isDiffered;
}
/**
* @param bool $isDiffered
*
* @return QuoteState
*/
public function setIsDiffered(bool $isDiffered): self
{
$this->isDiffered = $isDiffered;
return $this;
}
/**
* @return bool
*/
public function isNotCountForStats(): bool
{
return $this->isNotCountForStats;
}
/**
* @param bool $isNotCountForStats
*
* @return QuoteState
*/
public function setIsNotCountForStats(bool $isNotCountForStats): self
{
$this->isNotCountForStats = $isNotCountForStats;
return $this;
}
/**
* @return QuoteReason[]|Collection
*/
public function getReasons(): Collection
{
return $this->reasons;
}
/**
* @param QuoteReason $reason
*
* @return $this
*/
public function addQuoteReason(QuoteReason $reason): self
{
if (!$this->reasons->contains($reason)) {
$this->reasons->add($reason);
}
return $this;
}
/**
* @param QuoteReason $reason
*
* @return $this
*/
public function removeQuoteReason(QuoteReason $reason): self
{
if ($this->reasons->contains($reason)) {
$this->reasons->removeElement($reason);
}
return $this;
}
/**
* @param QuoteReason[]|Collection $reasons
*
* @return QuoteState
*/
public function setReasons(array $reasons): self
{
$this->reasons = $reasons;
return $this;
}
}