src/Entity/Slave/Ticket.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use App\Twig\Extension\AppExtension;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Table(name="eposm_s_ticket")
  10.  * @ORM\Entity(repositoryClass="App\Repository\Slave\TicketRepository")
  11.  */
  12. class Ticket
  13. {    
  14.     public function canDelete($type){
  15.         switch($type){
  16.             case 'all':
  17.                 if(sizeof($this->getSuspensions()) > 0) return false;
  18.                 if(sizeof($this->getInterventions()) > 0) return false;
  19.                 break;
  20.             case 'activities':
  21.                 foreach($this->getInterventions() as $intervention){
  22.                     if($intervention->getOutcomeType()->getSlug() == 'comleted')
  23.                         return false;
  24.                 }
  25.                 break;
  26.         }
  27.         return true;
  28.     }
  29.     
  30.     public function canMakeActionByStatus($statusesSlug){
  31.         $array = array();
  32.         if(str_contains($statusesSlug','))
  33.             $array explode(','$statusesSlug);
  34.         else
  35.             array_push($array$statusesSlug);
  36.         if(in_array($this->getStatus()->getSlug(), $array))
  37.             return true;
  38.         return false;
  39.     }
  40.     public function displayStatus($type$settingProcessedActive)
  41.     {
  42.         if($this->isSystemError()){
  43.             $color 'color_r';
  44.             $title 'Con errori';
  45.         }
  46.         else{
  47.             switch($this->getStatus()->getSlug()){
  48.                 case 'to_assign':
  49.                     $color 'color_lb';
  50.                     $title 'Da assegnare';
  51.                     break;
  52.                 case 'assigned':
  53.                     $color 'color_am';
  54.                     $title 'Assegnato';
  55.                     break;
  56.                 case 'taken_charge':
  57.                     $color 'color_gr';
  58.                     $title 'Presi in carico';
  59.                     break;
  60.                 case 'suspension_request':
  61.                     $color 'color_am';
  62.                     $title 'Richiesta sospensione';
  63.                     if($this->getActualSuspension()->getIntervention()->getOutcomeType()->getSlug() == 'empty'){
  64.                         $color 'color_r';
  65.                         $title 'Richiesta sospensione per UAV';
  66.                     }
  67.                     break;
  68.                 case 'suspended':
  69.                     $color 'color_am';
  70.                     $title 'Sospeso';
  71.                     if($this->getActualSuspension()->getIntervention()->getOutcomeType()->getSlug() == 'empty'){
  72.                         $color 'color_r';
  73.                         $title 'Sospeso per UAV';
  74.                     }
  75.                     break;
  76.                 case 'closed':
  77.                     $color 'color_gr';
  78.                     $title 'Chiuso';
  79.                     break;
  80.                 case 'closed_portal':
  81.                     $color 'color_gr_dark';
  82.                     $title 'Chiuso su fornitore';
  83.                     break;
  84.                 case 'canceled':
  85.                     $color 'color_r';
  86.                     $title 'Annullato';
  87.                     break;
  88.                 case 'wrong':
  89.                     $color 'color_r';
  90.                     $title 'Errato';
  91.                     break;
  92.                 case 'temp':
  93.                     $color 'color_r';
  94.                     $title 'Temporaneo';
  95.                     break;
  96.                 default: break;
  97.             }
  98.             if($settingProcessedActive && $this->getStatus()->getSlug() == 'taken_charge' && $this->isProcessed()){
  99.                 $color 'color_gr_dark';
  100.                 $title $this->getStatus()->getValue().' - Processato';
  101.             }
  102.         }
  103.         switch($type){
  104.             case 'icon': return '<i class="icon-circle cursor_p '.$color.'" data-bs-toggle="tooltip" title="'.$title.'"></i>'; break;
  105.             case 'string': return '<i class="icon-circle cursor_p '.$color.'"></i> '.$title; break;
  106.         }
  107.     }
  108.     public function displayJsonReport()
  109.     {
  110.         $html '';
  111.         if($this->jsonReport != '[]'){
  112.             $matrix json_decode($this->jsonReporttrue);
  113.             foreach($matrix as $array)
  114.                 foreach($array as $a)
  115.                     $html.= '<tr><th>'.array_keys($array)[0].'</th><td colspan="2">'.$a.'</td></tr>';
  116.         }
  117.         return $html;
  118.     }
  119.     public function displayTableJson()
  120.     {
  121.         $html '';
  122.         $first true;
  123.         $matrix json_decode($this->jsontrue);
  124.         $html.= '<table class="table table_no_padding m_b_none b_none font_12">';
  125.         foreach($matrix as $array)
  126.             foreach($array as $a)
  127.                 $html.= '<tr><th>'.array_keys($array)[0].'</th><td>'.$a.'</td></tr>';
  128.         
  129.         $html.= '</table>';
  130.         return $html;
  131.     }
  132.     public function displayJsonValueByColumn($column){
  133.         $matrix json_decode($this->jsontrue);
  134.         foreach($matrix as $array)
  135.             foreach($array as $a)
  136.                 if(strtolower(array_keys($array)[0]) == strtolower($column))
  137.                     return $a;
  138.         return '';
  139.     }
  140.     
  141.     public function displayJsonReportValueByColumn($column){
  142.         $matrix json_decode($this->jsonReporttrue);
  143.         foreach($matrix as $array)
  144.             foreach($array as $a)
  145.                 if(strtolower(array_keys($array)[0]) == strtolower($column))
  146.                     return $a;
  147.         return '';
  148.     }
  149.     
  150.     public function displayNumberAndOperation()
  151.     {
  152.         return 'Numero: '.$this->getNumber().' --- Cliente: '.$this->getClient().' --- Operazione: '.$this->getOperation()->getValue();
  153.     }
  154.     public function getActualSuspension()
  155.     {
  156.         $now = new \Datetime();
  157.         foreach($this->getSuspensions() as $suspension){
  158.             if($suspension->getDatetimeFrom()->format('YmdHis') <= $now->format('YmdHis') && !$suspension->isUnlocked()){
  159.                 return $suspension;
  160.             }
  161.         }
  162.         return null;
  163.     }
  164.     public function getLastSuspension()
  165.     {
  166.         $returnSus null;
  167.         $array = array();
  168.         foreach($this->getSuspensions() as $suspension){
  169.             if($suspension->isManaged() && $suspension->isApproved()){
  170.                 // SE LA DATA E' INDETERMINATA E' PER FORZA L'ULTIMA SOSPENSIONE, ALTRIMENTI AVREBBE UNA DATA DI SCADENZA
  171.                 if($suspension->getDatetimeTo() == null)
  172.                     return $suspension;
  173.                 array_push($array$suspension);
  174.             }
  175.         }
  176.         $first true;
  177.         foreach($array as $sus){
  178.             if($first || $returnSus->getDatetimeTo()->format('YmdHis') <= $sus->getDatetimeTo()->format('YmdHis')){
  179.                 $returnSus $sus;
  180.                 $first false;
  181.             }
  182.         }
  183.         return $returnSus;
  184.     }
  185.     
  186.     public function getInterventionCompleted()
  187.     {
  188.         foreach($this->getInterventions() as $intervention){
  189.             if($intervention->getOutcomeType()->getSlug() == 'completed'){
  190.                 return $intervention;
  191.             }
  192.         }
  193.         return null;
  194.     }
  195.     public function getOpenSuspension()
  196.     {
  197.         foreach($this->getSuspensions() as $sus){
  198.             if($sus->getDatetimeTo() == null && $sus->getRefuseMotivation() == 'Sospeso dal fornitore')
  199.                 return $sus;
  200.         }
  201.     }
  202.     /**
  203.      * @ORM\Column(name="id", type="bigint")
  204.      * @ORM\Id
  205.      * @ORM\GeneratedValue(strategy="AUTO")
  206.      */
  207.     protected $id;
  208.     
  209.     /**
  210.      * @ORM\Column(name="number", type="string", length=191, nullable=true)
  211.      */
  212.     protected $number;
  213.     /**
  214.      * @ORM\Column(name="datetime_import", type="datetime", nullable=true)
  215.      */
  216.     protected $datetimeImport;
  217.     /**
  218.      * @ORM\Column(name="datetime_start", type="datetime", nullable=true)
  219.      */
  220.     protected $datetimeStart;
  221.     /**
  222.      * @ORM\Column(name="datetime_expiration", type="datetime", nullable=true)
  223.      */
  224.     protected $datetimeExpiration;
  225.     /**
  226.      * @ORM\Column(name="datetime_end", type="datetime", nullable=true)
  227.      */
  228.     protected $datetimeEnd;
  229.     /**
  230.      * @ORM\Column(name="address", type="string", length=191, nullable=true)
  231.      */
  232.     protected $address;
  233.     /**
  234.      * @ORM\Column(name="locality", type="string", length=191, nullable=true)
  235.      */
  236.     protected $locality;
  237.     /**
  238.      * @ORM\Column(name="zip", type="string", length=191, nullable=true)
  239.      */
  240.     protected $zip;
  241.     /**
  242.      * @ORM\Column(name="id_city", type="bigint", nullable=true)
  243.      */
  244.     protected $idCity;
  245.     /**
  246.      * @ORM\Column(name="id_province", type="bigint", nullable=true)
  247.      */
  248.     protected $idProvince;
  249.     
  250.     /**
  251.      * @ORM\Column(name="other_city", type="string", length=191, nullable=true)
  252.      */
  253.     protected $otherCity;
  254.     /**
  255.      * @ORM\Column(name="system_error", type="boolean")
  256.      */
  257.     protected $systemError false;
  258.     
  259.     /**
  260.      * @ORM\Column(name="system_error_slug", type="string", length=191, nullable=true)
  261.      */
  262.     protected $systemErrorSlug;
  263.     /**
  264.      * @ORM\Column(name="system_error_details", type="text", nullable=true)
  265.      */
  266.     protected $systemErrorDetails;
  267.     
  268.     /**
  269.      * @ORM\Column(name="json", type="text", nullable=true)
  270.      */
  271.     protected $json;
  272.     
  273.     /**
  274.      * @ORM\Column(name="directory_path", type="string", length=191)
  275.      */
  276.     protected $directoryPath;
  277.     /**
  278.      * @ORM\Column(name="waybill", type="string", length=191, nullable=true)
  279.      */
  280.     protected $waybill;
  281.     
  282.     /**
  283.      * @ORM\Column(name="billable", type="boolean")
  284.      */
  285.     protected $billable true;
  286.     
  287.     /**
  288.      * @ORM\Column(name="json_report", type="text", nullable=true)
  289.      */
  290.     protected $jsonReport '[]';
  291.     
  292.     /**
  293.      * @ORM\Column(name="report_printed", type="boolean")
  294.      */
  295.     protected $reportPrinted false;
  296.     
  297.     /**
  298.      * @ORM\Column(name="processed", type="boolean")
  299.      */
  300.     protected $processed false;
  301.     /**
  302.      * @ORM\Column(name="closed_on_portal", type="boolean")
  303.      */
  304.     protected $closedOnPortal false;
  305.     // ManyToOne
  306.         /**
  307.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Supplier", inversedBy="tickets")
  308.          * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id")
  309.          */
  310.         private $supplier;
  311.         /**
  312.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Client", inversedBy="tickets")
  313.          * @ORM\JoinColumn(name="client_id", referencedColumnName="id")
  314.          */
  315.         private $client;
  316.         /**
  317.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Operation", inversedBy="tickets")
  318.          * @ORM\JoinColumn(name="operation_id", referencedColumnName="id")
  319.          */
  320.         private $operation;
  321.         /**
  322.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\User", inversedBy="tickets")
  323.          * @ORM\JoinColumn(name="technician_id", referencedColumnName="id")
  324.          */
  325.         private $technician;
  326.         /**
  327.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\TicketStatus", inversedBy="tickets")
  328.          * @ORM\JoinColumn(name="status_id", referencedColumnName="id")
  329.          */
  330.         private $status;
  331.         
  332.         /**
  333.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Termid", inversedBy="tickets")
  334.          * @ORM\JoinColumn(name="termid_id", referencedColumnName="id")
  335.          */
  336.         private $termid;
  337.         
  338.         /**
  339.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationTariffAmount", inversedBy="tickets")
  340.          * @ORM\JoinColumn(name="operation_tariff_amount_id", referencedColumnName="id")
  341.          */
  342.         private $operationTariffAmount;
  343.                 
  344.         /**
  345.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationTariffAmount", inversedBy="uavTickets")
  346.          * @ORM\JoinColumn(name="uav_operation_tariff_amount_id", referencedColumnName="id")
  347.          */
  348.         private $uavOperationTariffAmount;
  349.     //
  350.     // OneToMany
  351.         /**
  352.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketSuspension", mappedBy="ticket")
  353.          */
  354.         private $suspensions;
  355.         /**
  356.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Intervention", mappedBy="ticket")
  357.          */
  358.         private $interventions;
  359.         
  360.         /**
  361.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketReminder", mappedBy="ticket")
  362.          */
  363.         private $reminders;
  364.         
  365.         /**
  366.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketLog", mappedBy="ticket")
  367.          */
  368.         private $logs;
  369.         public function __construct()
  370.         {
  371.             $this->suspensions = new ArrayCollection();
  372.             $this->interventions = new ArrayCollection();
  373.             $this->reminders = new ArrayCollection();
  374.             $this->logs = new ArrayCollection();
  375.         }
  376.         public function getId(): ?string
  377.         {
  378.             return $this->id;
  379.         }
  380.         public function getNumber(): ?string
  381.         {
  382.             return $this->number;
  383.         }
  384.         public function setNumber(?string $number): static
  385.         {
  386.             $this->number $number;
  387.             return $this;
  388.         }
  389.         public function getDatetimeImport(): ?\DateTimeInterface
  390.         {
  391.             return $this->datetimeImport;
  392.         }
  393.         public function setDatetimeImport(?\DateTimeInterface $datetimeImport): static
  394.         {
  395.             $this->datetimeImport $datetimeImport;
  396.             return $this;
  397.         }
  398.         public function getDatetimeStart(): ?\DateTimeInterface
  399.         {
  400.             return $this->datetimeStart;
  401.         }
  402.         public function setDatetimeStart(?\DateTimeInterface $datetimeStart): static
  403.         {
  404.             $this->datetimeStart $datetimeStart;
  405.             return $this;
  406.         }
  407.         public function getDatetimeExpiration(): ?\DateTimeInterface
  408.         {
  409.             return $this->datetimeExpiration;
  410.         }
  411.         public function setDatetimeExpiration(?\DateTimeInterface $datetimeExpiration): static
  412.         {
  413.             $this->datetimeExpiration $datetimeExpiration;
  414.             return $this;
  415.         }
  416.         public function getDatetimeEnd(): ?\DateTimeInterface
  417.         {
  418.             return $this->datetimeEnd;
  419.         }
  420.         public function setDatetimeEnd(?\DateTimeInterface $datetimeEnd): static
  421.         {
  422.             $this->datetimeEnd $datetimeEnd;
  423.             return $this;
  424.         }
  425.         public function getAddress(): ?string
  426.         {
  427.             return $this->address;
  428.         }
  429.         public function setAddress(?string $address): static
  430.         {
  431.             $this->address $address;
  432.             return $this;
  433.         }
  434.         public function getLocality(): ?string
  435.         {
  436.             return $this->locality;
  437.         }
  438.         public function setLocality(?string $locality): static
  439.         {
  440.             $this->locality $locality;
  441.             return $this;
  442.         }
  443.         public function getZip(): ?string
  444.         {
  445.             return $this->zip;
  446.         }
  447.         public function setZip(?string $zip): static
  448.         {
  449.             $this->zip $zip;
  450.             return $this;
  451.         }
  452.         public function getIdCity(): ?string
  453.         {
  454.             return $this->idCity;
  455.         }
  456.         public function setIdCity(?string $idCity): static
  457.         {
  458.             $this->idCity $idCity;
  459.             return $this;
  460.         }
  461.         public function getIdProvince(): ?string
  462.         {
  463.             return $this->idProvince;
  464.         }
  465.         public function setIdProvince(?string $idProvince): static
  466.         {
  467.             $this->idProvince $idProvince;
  468.             return $this;
  469.         }
  470.         public function getOtherCity(): ?string
  471.         {
  472.             return $this->otherCity;
  473.         }
  474.         public function setOtherCity(?string $otherCity): static
  475.         {
  476.             $this->otherCity $otherCity;
  477.             return $this;
  478.         }
  479.         public function isSystemError(): ?bool
  480.         {
  481.             return $this->systemError;
  482.         }
  483.         public function setSystemError(bool $systemError): static
  484.         {
  485.             $this->systemError $systemError;
  486.             return $this;
  487.         }
  488.         public function getSystemErrorSlug(): ?string
  489.         {
  490.             return $this->systemErrorSlug;
  491.         }
  492.         public function setSystemErrorSlug(?string $systemErrorSlug): static
  493.         {
  494.             $this->systemErrorSlug $systemErrorSlug;
  495.             return $this;
  496.         }
  497.         public function getSystemErrorDetails(): ?string
  498.         {
  499.             return $this->systemErrorDetails;
  500.         }
  501.         public function setSystemErrorDetails(?string $systemErrorDetails): static
  502.         {
  503.             $this->systemErrorDetails $systemErrorDetails;
  504.             return $this;
  505.         }
  506.         public function getJson(): ?string
  507.         {
  508.             return $this->json;
  509.         }
  510.         public function setJson(?string $json): static
  511.         {
  512.             $this->json $json;
  513.             return $this;
  514.         }
  515.         public function getDirectoryPath(): ?string
  516.         {
  517.             return $this->directoryPath;
  518.         }
  519.         public function setDirectoryPath(string $directoryPath): static
  520.         {
  521.             $this->directoryPath $directoryPath;
  522.             return $this;
  523.         }
  524.         public function getWaybill(): ?string
  525.         {
  526.             return $this->waybill;
  527.         }
  528.         public function setWaybill(?string $waybill): static
  529.         {
  530.             $this->waybill $waybill;
  531.             return $this;
  532.         }
  533.         public function isBillable(): ?bool
  534.         {
  535.             return $this->billable;
  536.         }
  537.         public function setBillable(bool $billable): static
  538.         {
  539.             $this->billable $billable;
  540.             return $this;
  541.         }
  542.         public function getJsonReport(): ?string
  543.         {
  544.             return $this->jsonReport;
  545.         }
  546.         public function setJsonReport(?string $jsonReport): static
  547.         {
  548.             $this->jsonReport $jsonReport;
  549.             return $this;
  550.         }
  551.         public function isReportPrinted(): ?bool
  552.         {
  553.             return $this->reportPrinted;
  554.         }
  555.         public function setReportPrinted(bool $reportPrinted): static
  556.         {
  557.             $this->reportPrinted $reportPrinted;
  558.             return $this;
  559.         }
  560.         public function isProcessed(): ?bool
  561.         {
  562.             return $this->processed;
  563.         }
  564.         public function setProcessed(bool $processed): static
  565.         {
  566.             $this->processed $processed;
  567.             return $this;
  568.         }
  569.         public function isClosedOnPortal(): ?bool
  570.         {
  571.             return $this->closedOnPortal;
  572.         }
  573.         public function setClosedOnPortal(bool $closedOnPortal): static
  574.         {
  575.             $this->closedOnPortal $closedOnPortal;
  576.             return $this;
  577.         }
  578.         public function getSupplier(): ?Supplier
  579.         {
  580.             return $this->supplier;
  581.         }
  582.         public function setSupplier(?Supplier $supplier): static
  583.         {
  584.             $this->supplier $supplier;
  585.             return $this;
  586.         }
  587.         public function getClient(): ?Client
  588.         {
  589.             return $this->client;
  590.         }
  591.         public function setClient(?Client $client): static
  592.         {
  593.             $this->client $client;
  594.             return $this;
  595.         }
  596.         public function getOperation(): ?Operation
  597.         {
  598.             return $this->operation;
  599.         }
  600.         public function setOperation(?Operation $operation): static
  601.         {
  602.             $this->operation $operation;
  603.             return $this;
  604.         }
  605.         public function getTechnician(): ?User
  606.         {
  607.             return $this->technician;
  608.         }
  609.         public function setTechnician(?User $technician): static
  610.         {
  611.             $this->technician $technician;
  612.             return $this;
  613.         }
  614.         public function getStatus(): ?TicketStatus
  615.         {
  616.             return $this->status;
  617.         }
  618.         public function setStatus(?TicketStatus $status): static
  619.         {
  620.             $this->status $status;
  621.             return $this;
  622.         }
  623.         public function getTermid(): ?Termid
  624.         {
  625.             return $this->termid;
  626.         }
  627.         public function setTermid(?Termid $termid): static
  628.         {
  629.             $this->termid $termid;
  630.             return $this;
  631.         }
  632.         public function getOperationTariffAmount(): ?OperationTariffAmount
  633.         {
  634.             return $this->operationTariffAmount;
  635.         }
  636.         public function setOperationTariffAmount(?OperationTariffAmount $operationTariffAmount): static
  637.         {
  638.             $this->operationTariffAmount $operationTariffAmount;
  639.             return $this;
  640.         }
  641.         public function getUavOperationTariffAmount(): ?OperationTariffAmount
  642.         {
  643.             return $this->uavOperationTariffAmount;
  644.         }
  645.         public function setUavOperationTariffAmount(?OperationTariffAmount $uavOperationTariffAmount): static
  646.         {
  647.             $this->uavOperationTariffAmount $uavOperationTariffAmount;
  648.             return $this;
  649.         }
  650.         /**
  651.          * @return Collection<int, TicketSuspension>
  652.          */
  653.         public function getSuspensions(): Collection
  654.         {
  655.             return $this->suspensions;
  656.         }
  657.         public function addSuspension(TicketSuspension $suspension): static
  658.         {
  659.             if (!$this->suspensions->contains($suspension)) {
  660.                 $this->suspensions->add($suspension);
  661.                 $suspension->setTicket($this);
  662.             }
  663.             return $this;
  664.         }
  665.         public function removeSuspension(TicketSuspension $suspension): static
  666.         {
  667.             if ($this->suspensions->removeElement($suspension)) {
  668.                 // set the owning side to null (unless already changed)
  669.                 if ($suspension->getTicket() === $this) {
  670.                     $suspension->setTicket(null);
  671.                 }
  672.             }
  673.             return $this;
  674.         }
  675.         /**
  676.          * @return Collection<int, Intervention>
  677.          */
  678.         public function getInterventions(): Collection
  679.         {
  680.             return $this->interventions;
  681.         }
  682.         public function addIntervention(Intervention $intervention): static
  683.         {
  684.             if (!$this->interventions->contains($intervention)) {
  685.                 $this->interventions->add($intervention);
  686.                 $intervention->setTicket($this);
  687.             }
  688.             return $this;
  689.         }
  690.         public function removeIntervention(Intervention $intervention): static
  691.         {
  692.             if ($this->interventions->removeElement($intervention)) {
  693.                 // set the owning side to null (unless already changed)
  694.                 if ($intervention->getTicket() === $this) {
  695.                     $intervention->setTicket(null);
  696.                 }
  697.             }
  698.             return $this;
  699.         }
  700.         /**
  701.          * @return Collection<int, TicketReminder>
  702.          */
  703.         public function getReminders(): Collection
  704.         {
  705.             return $this->reminders;
  706.         }
  707.         public function addReminder(TicketReminder $reminder): static
  708.         {
  709.             if (!$this->reminders->contains($reminder)) {
  710.                 $this->reminders->add($reminder);
  711.                 $reminder->setTicket($this);
  712.             }
  713.             return $this;
  714.         }
  715.         public function removeReminder(TicketReminder $reminder): static
  716.         {
  717.             if ($this->reminders->removeElement($reminder)) {
  718.                 // set the owning side to null (unless already changed)
  719.                 if ($reminder->getTicket() === $this) {
  720.                     $reminder->setTicket(null);
  721.                 }
  722.             }
  723.             return $this;
  724.         }
  725.         /**
  726.          * @return Collection<int, TicketLog>
  727.          */
  728.         public function getLogs(): Collection
  729.         {
  730.             return $this->logs;
  731.         }
  732.         public function addLog(TicketLog $log): static
  733.         {
  734.             if (!$this->logs->contains($log)) {
  735.                 $this->logs->add($log);
  736.                 $log->setTicket($this);
  737.             }
  738.             return $this;
  739.         }
  740.         public function removeLog(TicketLog $log): static
  741.         {
  742.             if ($this->logs->removeElement($log)) {
  743.                 // set the owning side to null (unless already changed)
  744.                 if ($log->getTicket() === $this) {
  745.                     $log->setTicket(null);
  746.                 }
  747.             }
  748.             return $this;
  749.         }
  750. }