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

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