src/V4/Model/Quote/QuoteSearch.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\V4\Model\Quote;
  3. use App\Model\Compare\DateCompare;
  4. use App\Model\Compare\NumberCompare;
  5. use App\Model\SpecificField\SpecificField;
  6. use App\Model\SpecificFieldsAwareInterface;
  7. use App\Model\Traits\BlamableTrait;
  8. use App\Model\Traits\ImportableObjectTrait;
  9. use App\Model\Traits\TimeStampableCompare;
  10. use App\V4\Model\IdSearchTrait;
  11. use App\V4\Model\QuoteSpecificField\QuoteSpecificField;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Symfony\Component\Serializer\Annotation\Groups;
  15. class QuoteSearch implements SpecificFieldsAwareInterface
  16. {
  17.     public const SPECIFIC_FIELD_CLASS_NAME QuoteSpecificField::class;
  18.     use ImportableObjectTrait;
  19.     use BlamableTrait;
  20.     use TimeStampableCompare;
  21.     use IdSearchTrait;
  22.     /**
  23.      * Titre de l'offre.
  24.      *
  25.      * @var string|null
  26.      * @Groups({"quote:search"})
  27.      */
  28.     private $name;
  29.     /**
  30.      * Numéro de devis.
  31.      *
  32.      * @var string|null
  33.      * @Groups({"quote:search"})
  34.      */
  35.     private $quoteNumber;
  36.     /**
  37.      * Numéro de contrat.
  38.      *
  39.      * @var string|null
  40.      * @Groups({"quote:search"})
  41.      */
  42.     private $contractNumber;
  43.     /**
  44.      * @var array|null
  45.      * @Groups({"quote:search"})
  46.      */
  47.     private $status;
  48.     /**
  49.      * @var string|null
  50.      * @Groups({"quote:search"})
  51.      */
  52.     private $salesForecast;
  53.     /**
  54.      * @var DateCompare|null
  55.      * @Groups({"quote:search"})
  56.      */
  57.     private $issuedAt;
  58.     /**
  59.      * @var DateCompare|null
  60.      * @Groups({"quote:search"})
  61.      */
  62.     private $warrantlyAt;
  63.     /**
  64.      * @var DateCompare|null
  65.      * @Groups({"quote:search"})
  66.      */
  67.     private $expiredAt;
  68.     /**
  69.      * @var DateCompare|null
  70.      * @Groups({"quote:search"})
  71.      */
  72.     private $expectedSignedAt;
  73.     /**
  74.      * @var array|null
  75.      * @Groups({"quote:search"})
  76.      */
  77.     private $managedBy;
  78.     /**
  79.      * @var NumberCompare|null
  80.      * @Groups({"quote:search"})
  81.      */
  82.     private $totalExcludingVat;
  83.     /**
  84.      * @var float|null
  85.      * @Groups({"quote:search"})
  86.      */
  87.     private $potential;
  88.     /**
  89.      * Mes devis.
  90.      *
  91.      * @var bool|null
  92.      * @Groups({"quote:search"})
  93.      */
  94.     private $myQuotes;
  95.     /**
  96.      * contrat de maintenance ?
  97.      *
  98.      * @var bool|null
  99.      * @Groups({"isMaintenance"})
  100.      */
  101.     private $isMaintenance;
  102.     /**
  103.      * @Groups({"quote:search"})
  104.      *
  105.      * @var array|null
  106.      */
  107.     private $prospectIds = [];
  108.     /**
  109.      * @var array
  110.      *
  111.      * @Groups({"quote:search"})
  112.      */
  113.     private $productIds = [];
  114.     /**
  115.      * @Groups({"quote:search"})
  116.      *
  117.      * @var array|null
  118.      */
  119.     private $contactIds = [];
  120.     /**
  121.      * @var array|null
  122.      * @Groups({"quote:search"})
  123.      */
  124.     private $prospects;
  125.     /**
  126.      * Section de l'offre.
  127.      *
  128.      * @var string|null
  129.      * @Groups({"quote:search"})
  130.      */
  131.     private $sectionName;
  132.     /**
  133.      * @var SpecificField[]|Collection
  134.      *
  135.      * @Groups({"prospect:search"})
  136.      */
  137.     private $specificFields;
  138.     /**
  139.      * @var array|null
  140.      * @Groups({"quote:search"})
  141.      */
  142.     private $reason;
  143.     /**
  144.      * Commentaire de la raison.
  145.      *
  146.      * @var string|null
  147.      * @Groups({"quote:search"})
  148.      */
  149.     private $reasonComment;
  150.     /**
  151.      * @var string|null
  152.      *
  153.      * @Groups({"quote:search"})
  154.      */
  155.     private $fileLabel;
  156.     public function __construct()
  157.     {
  158.         $this->specificFields = new ArrayCollection();
  159.     }
  160.     /**
  161.      * {@inheritdoc}
  162.      */
  163.     public function getSpecificFields(): Collection
  164.     {
  165.         return $this->specificFields;
  166.     }
  167.     /**
  168.      * {@inheritdoc}
  169.      */
  170.     public function getSpecificFieldByFieldId(string $id): ?SpecificField
  171.     {
  172.         foreach ($this->specificFields as $specificField) {
  173.             if ($specificField->getFieldId() === $id) {
  174.                 return $specificField;
  175.             }
  176.         }
  177.         return null;
  178.     }
  179.     /**
  180.      * @see ImportableObjectTrait::class
  181.      *
  182.      * @param QuoteSpecificField $specificField
  183.      *
  184.      * @return $this
  185.      */
  186.     public function addQuoteSpecificField(QuoteSpecificField $specificField): self
  187.     {
  188.         return $this->addSpecificField($specificField);
  189.     }
  190.     /**
  191.      * {@inheritdoc}
  192.      */
  193.     public function addSpecificField($specificField): SpecificFieldsAwareInterface
  194.     {
  195.         $this->specificFields[] = $specificField;
  196.         return $this;
  197.     }
  198.     /**
  199.      * {@inheritdoc}
  200.      */
  201.     public function setSpecificFields(Collection $specificFields): self
  202.     {
  203.         $this->specificFields $specificFields;
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return string|null
  208.      */
  209.     public function getName(): ?string
  210.     {
  211.         return $this->name;
  212.     }
  213.     /**
  214.      * @param string|null $name
  215.      *
  216.      * @return QuoteSearch
  217.      */
  218.     public function setName(?string $name): QuoteSearch
  219.     {
  220.         $this->name $name;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return bool|null
  225.      */
  226.     public function getMyQuotes(): ?bool
  227.     {
  228.         return $this->myQuotes;
  229.     }
  230.     /**
  231.      * @param bool|null $myQuotes
  232.      *
  233.      * @return QuoteSearch
  234.      */
  235.     public function setMyQuotes(?bool $myQuotes): QuoteSearch
  236.     {
  237.         $this->myQuotes $myQuotes;
  238.         return $this;
  239.     }
  240.     /**
  241.      * @return string|null
  242.      */
  243.     public function getQuoteNumber(): ?string
  244.     {
  245.         return $this->quoteNumber;
  246.     }
  247.     /**
  248.      * @param string|null $quoteNumber
  249.      *
  250.      * @return QuoteSearch
  251.      */
  252.     public function setQuoteNumber(?string $quoteNumber): QuoteSearch
  253.     {
  254.         $this->quoteNumber $quoteNumber;
  255.         return $this;
  256.     }
  257.     /**
  258.      * @return string|null
  259.      */
  260.     public function getSalesForecast(): ?string
  261.     {
  262.         return $this->salesForecast;
  263.     }
  264.     /**
  265.      * @param string|null $salesForecast
  266.      *
  267.      * @return QuoteSearch
  268.      */
  269.     public function setSalesForecast(?string $salesForecast): QuoteSearch
  270.     {
  271.         $this->salesForecast $salesForecast;
  272.         return $this;
  273.     }
  274.     /**
  275.      * @return DateCompare|null
  276.      */
  277.     public function getIssuedAt(): ?DateCompare
  278.     {
  279.         return $this->issuedAt;
  280.     }
  281.     /**
  282.      * @param DateCompare|null $issuedAt
  283.      *
  284.      * @return QuoteSearch
  285.      */
  286.     public function setIssuedAt(?DateCompare $issuedAt): QuoteSearch
  287.     {
  288.         $this->issuedAt $issuedAt;
  289.         return $this;
  290.     }
  291.     /**
  292.      * @return DateCompare|null
  293.      */
  294.     public function getExpectedSignedAt(): ?DateCompare
  295.     {
  296.         return $this->expectedSignedAt;
  297.     }
  298.     /**
  299.      * @param DateCompare|null $expectedSignedAt
  300.      *
  301.      * @return QuoteSearch
  302.      */
  303.     public function setExpectedSignedAt(?DateCompare $expectedSignedAt): QuoteSearch
  304.     {
  305.         $this->expectedSignedAt $expectedSignedAt;
  306.         return $this;
  307.     }
  308.     /**
  309.      * @return NumberCompare|null
  310.      */
  311.     public function getTotalExcludingVat(): ?NumberCompare
  312.     {
  313.         return $this->totalExcludingVat;
  314.     }
  315.     /**
  316.      * @param NumberCompare|null $totalExcludingVat
  317.      *
  318.      * @return QuoteSearch
  319.      */
  320.     public function setTotalExcludingVat(?NumberCompare $totalExcludingVat): QuoteSearch
  321.     {
  322.         $this->totalExcludingVat $totalExcludingVat;
  323.         return $this;
  324.     }
  325.     /**
  326.      * @return float|null
  327.      */
  328.     public function getPotential(): ?float
  329.     {
  330.         return $this->potential;
  331.     }
  332.     /**
  333.      * @param float|null $potential
  334.      *
  335.      * @return QuoteSearch
  336.      */
  337.     public function setPotential(?float $potential): QuoteSearch
  338.     {
  339.         $this->potential $potential;
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return array|null
  344.      */
  345.     public function getProspectIds(): ?array
  346.     {
  347.         return $this->prospectIds;
  348.     }
  349.     /**
  350.      * @param array|null $prospectIds
  351.      *
  352.      * @return QuoteSearch
  353.      */
  354.     public function setProspectIds(?array $prospectIds): QuoteSearch
  355.     {
  356.         $this->prospectIds $prospectIds;
  357.         return $this;
  358.     }
  359.     /**
  360.      * @return array
  361.      */
  362.     public function getProductIds(): array
  363.     {
  364.         return $this->productIds;
  365.     }
  366.     /**
  367.      * @param array $productIds
  368.      *
  369.      * @return self
  370.      */
  371.     public function setProductIds(array $productIds): self
  372.     {
  373.         $this->productIds $productIds;
  374.         return $this;
  375.     }
  376.     /**
  377.      * @return array|null
  378.      */
  379.     public function getContactIds(): ?array
  380.     {
  381.         return $this->contactIds;
  382.     }
  383.     /**
  384.      * @param array|null $contactIds
  385.      *
  386.      * @return QuoteSearch
  387.      */
  388.     public function setContactIds(?array $contactIds): QuoteSearch
  389.     {
  390.         $this->contactIds $contactIds;
  391.         return $this;
  392.     }
  393.     /**
  394.      * @return DateCompare|null
  395.      */
  396.     public function getWarrantlyAt(): ?DateCompare
  397.     {
  398.         return $this->warrantlyAt;
  399.     }
  400.     /**
  401.      * @param DateCompare|null $warrantlyAt
  402.      *
  403.      * @return QuoteSearch
  404.      */
  405.     public function setWarrantlyAt(?DateCompare $warrantlyAt): QuoteSearch
  406.     {
  407.         $this->warrantlyAt $warrantlyAt;
  408.         return $this;
  409.     }
  410.     /**
  411.      * @return DateCompare|null
  412.      */
  413.     public function getExpiredAt(): ?DateCompare
  414.     {
  415.         return $this->expiredAt;
  416.     }
  417.     /**
  418.      * @param DateCompare|null $expiredAt
  419.      *
  420.      * @return QuoteSearch
  421.      */
  422.     public function setExpiredAt(?DateCompare $expiredAt): QuoteSearch
  423.     {
  424.         $this->expiredAt $expiredAt;
  425.         return $this;
  426.     }
  427.     /**
  428.      * @return bool|null
  429.      */
  430.     public function getIsMaintenance(): ?bool
  431.     {
  432.         return $this->isMaintenance;
  433.     }
  434.     /**
  435.      * @param bool|null $isMaintenance
  436.      *
  437.      * @return QuoteSearch
  438.      */
  439.     public function setIsMaintenance(?bool $isMaintenance): QuoteSearch
  440.     {
  441.         $this->isMaintenance $isMaintenance;
  442.         return $this;
  443.     }
  444.     /**
  445.      * @return string|null
  446.      */
  447.     public function getContractNumber(): ?string
  448.     {
  449.         return $this->contractNumber;
  450.     }
  451.     /**
  452.      * @param string|null $contractNumber
  453.      *
  454.      * @return QuoteSearch
  455.      */
  456.     public function setContractNumber(?string $contractNumber): QuoteSearch
  457.     {
  458.         $this->contractNumber $contractNumber;
  459.         return $this;
  460.     }
  461.     /**
  462.      * @return array|null
  463.      */
  464.     public function getProspects(): ?array
  465.     {
  466.         return $this->prospects;
  467.     }
  468.     /**
  469.      * @param array|null $prospects
  470.      *
  471.      * @return QuoteSearch
  472.      */
  473.     public function setProspects(?array $prospects): QuoteSearch
  474.     {
  475.         $this->prospects $prospects;
  476.         return $this;
  477.     }
  478.     /**
  479.      * @return array|null
  480.      */
  481.     public function getStatus(): ?array
  482.     {
  483.         return $this->status;
  484.     }
  485.     /**
  486.      * @param array|null $status
  487.      *
  488.      * @return QuoteSearch
  489.      */
  490.     public function setStatus(?array $status): QuoteSearch
  491.     {
  492.         $this->status $status;
  493.         return $this;
  494.     }
  495.     /**
  496.      * @return array|null
  497.      */
  498.     public function getManagedBy(): ?array
  499.     {
  500.         return $this->managedBy;
  501.     }
  502.     /**
  503.      * @param array|null $managedBy
  504.      *
  505.      * @return QuoteSearch
  506.      */
  507.     public function setManagedBy(?array $managedBy): QuoteSearch
  508.     {
  509.         $this->managedBy $managedBy;
  510.         return $this;
  511.     }
  512.     /**
  513.      * @return string|null
  514.      */
  515.     public function getSectionName(): ?string
  516.     {
  517.         return $this->sectionName;
  518.     }
  519.     /**
  520.      * @param string|null $sectionName
  521.      *
  522.      * @return QuoteSearch
  523.      */
  524.     public function setSectionName(?string $sectionName): QuoteSearch
  525.     {
  526.         $this->sectionName $sectionName;
  527.         return $this;
  528.     }
  529.     /**
  530.      * @return array|null
  531.      */
  532.     public function getReason(): ?array
  533.     {
  534.         return $this->reason;
  535.     }
  536.     /**
  537.      * @param array|null $reason
  538.      *
  539.      * @return QuoteSearch
  540.      */
  541.     public function setReason(?array $reason): QuoteSearch
  542.     {
  543.         $this->reason $reason;
  544.         return $this;
  545.     }
  546.     /**
  547.      * @return string|null
  548.      */
  549.     public function getReasonComment(): ?string
  550.     {
  551.         return $this->reasonComment;
  552.     }
  553.     /**
  554.      * @param string|null $reasonComment
  555.      *
  556.      * @return QuoteSearch
  557.      */
  558.     public function setReasonComment(?string $reasonComment): QuoteSearch
  559.     {
  560.         $this->reasonComment $reasonComment;
  561.         return $this;
  562.     }
  563.     public function getFileLabel(): ?string
  564.     {
  565.         return $this->fileLabel;
  566.     }
  567.     public function setFileLabel(?string $fileLabel): self
  568.     {
  569.         $this->fileLabel $fileLabel;
  570.         return $this;
  571.     }
  572. }