src/Entity/Slave/Ticket.php line 143

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.             case 'text': return $title; break;
  107.             default: break;
  108.         }
  109.     }
  110.     public function displayJsonReport()
  111.     {
  112.         $html '';
  113.         if($this->jsonReport != '[]'){
  114.             $matrix json_decode($this->jsonReporttrue);
  115.             foreach($matrix as $array)
  116.                 foreach($array as $a)
  117.                     $html.= '<tr><th>'.array_keys($array)[0].'</th><td colspan="2">'.$a.'</td></tr>';
  118.         }
  119.         return $html;
  120.     }
  121.     public function displayTableJson()
  122.     {
  123.         $html '';
  124.         $first true;
  125.         $matrix json_decode($this->jsontrue);
  126.         $html.= '<table class="table table_no_padding m_b_none b_none font_12">';
  127.         foreach($matrix as $array)
  128.             foreach($array as $a)
  129.                 $html.= '<tr><th>'.array_keys($array)[0].'</th><td>'.$a.'</td></tr>';
  130.         
  131.         $html.= '</table>';
  132.         return $html;
  133.     }
  134.     public function displayJsonValueByColumn($column){
  135.         $matrix json_decode($this->jsontrue);
  136.         foreach($matrix as $array)
  137.             foreach($array as $a)
  138.                 if(strtolower(array_keys($array)[0]) == strtolower($column))
  139.                     return $a;
  140.         return '';
  141.     }
  142.     
  143.     public function displayJsonReportValueByColumn($column){
  144.         $matrix json_decode($this->jsonReporttrue);
  145.         foreach($matrix as $array)
  146.             foreach($array as $a)
  147.                 if(strtolower(array_keys($array)[0]) == strtolower($column))
  148.                     return $a;
  149.         return '';
  150.     }
  151.     
  152.     public function displayNumberAndOperation()
  153.     {
  154.         return 'Numero: '.$this->getNumber().' --- Cliente: '.$this->getClient().' --- Operazione: '.$this->getOperation()->getValue();
  155.     }
  156.     public function getActualSuspension()
  157.     {
  158.         $now = new \Datetime();
  159.         foreach($this->getSuspensions() as $suspension){
  160.             if($suspension->getDatetimeFrom()->format('YmdHis') <= $now->format('YmdHis') && !$suspension->isUnlocked()){
  161.                 return $suspension;
  162.             }
  163.         }
  164.         return null;
  165.     }
  166.     public function getLastSuspension()
  167.     {
  168.         $returnSus null;
  169.         $array = array();
  170.         foreach($this->getSuspensions() as $suspension){
  171.             if($suspension->isManaged() && $suspension->isApproved()){
  172.                 // SE LA DATA E' INDETERMINATA E' PER FORZA L'ULTIMA SOSPENSIONE, ALTRIMENTI AVREBBE UNA DATA DI SCADENZA
  173.                 if($suspension->getDatetimeTo() == null)
  174.                     return $suspension;
  175.                 array_push($array$suspension);
  176.             }
  177.         }
  178.         $first true;
  179.         foreach($array as $sus){
  180.             if($first || $returnSus->getDatetimeTo()->format('YmdHis') <= $sus->getDatetimeTo()->format('YmdHis')){
  181.                 $returnSus $sus;
  182.                 $first false;
  183.             }
  184.         }
  185.         return $returnSus;
  186.     }
  187.     
  188.     public function getInterventionCompleted()
  189.     {
  190.         foreach($this->getInterventions() as $intervention){
  191.             if($intervention->getOutcomeType()->getSlug() == 'completed'){
  192.                 return $intervention;
  193.             }
  194.         }
  195.         return null;
  196.     }
  197.     public function getOpenSuspension()
  198.     {
  199.         foreach($this->getSuspensions() as $sus){
  200.             if($sus->getDatetimeTo() == null && $sus->getRefuseMotivation() == 'Sospeso dal fornitore')
  201.                 return $sus;
  202.         }
  203.     }
  204.     public function displayTags($type){
  205.         $first true;
  206.         $result '';
  207.         switch($type){
  208.             case 'string':
  209.                 foreach($this->getTicketTags() as $tag){
  210.                     if($first$first false; else $result.= ', ';
  211.                     $result.= $tag->getName();
  212.                 }
  213.                 break;
  214.             case 'icon':
  215.                 foreach($this->getTicketTags() as $tag){
  216.                     if($first$first false; else $result.= ' ';
  217.                     $result.= '<i class="icon-circle" style="color:'.$tag->getColor().'" data-bs-toggle="tooltip" title="'.$tag->getName().'"></i>';
  218.                 }
  219.                 break;
  220.             case 'all':
  221.                 foreach($this->getTicketTags() as $tag){
  222.                     if($first$first false; else $result.= ' ';
  223.                     $result.= '<i class="icon-circle" style="color:'.$tag->getColor().'"></i> '.$tag->getName();
  224.                 }
  225.                 break;
  226.         }
  227.         return $result;
  228.     }
  229.     /**
  230.      * @ORM\Column(name="id", type="bigint")
  231.      * @ORM\Id
  232.      * @ORM\GeneratedValue(strategy="AUTO")
  233.      */
  234.     protected $id;
  235.     
  236.     /**
  237.      * @ORM\Column(name="number", type="string", length=191, nullable=true)
  238.      */
  239.     protected $number;
  240.     /**
  241.      * @ORM\Column(name="datetime_import", type="datetime", nullable=true)
  242.      */
  243.     protected $datetimeImport;
  244.     /**
  245.      * @ORM\Column(name="datetime_start", type="datetime", nullable=true)
  246.      */
  247.     protected $datetimeStart;
  248.     /**
  249.      * @ORM\Column(name="datetime_expiration", type="datetime", nullable=true)
  250.      */
  251.     protected $datetimeExpiration;
  252.     /**
  253.      * @ORM\Column(name="datetime_end", type="datetime", nullable=true)
  254.      */
  255.     protected $datetimeEnd;
  256.     /**
  257.      * @ORM\Column(name="address", type="string", length=191, nullable=true)
  258.      */
  259.     protected $address;
  260.     /**
  261.      * @ORM\Column(name="locality", type="string", length=191, nullable=true)
  262.      */
  263.     protected $locality;
  264.     /**
  265.      * @ORM\Column(name="zip", type="string", length=191, nullable=true)
  266.      */
  267.     protected $zip;
  268.     /**
  269.      * @ORM\Column(name="id_city", type="bigint", nullable=true)
  270.      */
  271.     protected $idCity;
  272.     /**
  273.      * @ORM\Column(name="id_province", type="bigint", nullable=true)
  274.      */
  275.     protected $idProvince;
  276.     
  277.     /**
  278.      * @ORM\Column(name="other_city", type="string", length=191, nullable=true)
  279.      */
  280.     protected $otherCity;
  281.     /**
  282.      * @ORM\Column(name="system_error", type="boolean")
  283.      */
  284.     protected $systemError false;
  285.     
  286.     /**
  287.      * @ORM\Column(name="system_error_slug", type="string", length=191, nullable=true)
  288.      */
  289.     protected $systemErrorSlug;
  290.     /**
  291.      * @ORM\Column(name="system_error_details", type="text", nullable=true)
  292.      */
  293.     protected $systemErrorDetails;
  294.     
  295.     /**
  296.      * @ORM\Column(name="json", type="text", nullable=true)
  297.      */
  298.     protected $json;
  299.     
  300.     /**
  301.      * @ORM\Column(name="directory_path", type="string", length=191)
  302.      */
  303.     protected $directoryPath;
  304.     /**
  305.      * @ORM\Column(name="waybill", type="string", length=191, nullable=true)
  306.      */
  307.     protected $waybill;
  308.     
  309.     /**
  310.      * @ORM\Column(name="billable", type="boolean")
  311.      */
  312.     protected $billable true;
  313.     
  314.     /**
  315.      * @ORM\Column(name="json_report", type="text", nullable=true)
  316.      */
  317.     protected $jsonReport '[]';
  318.     /**
  319.      * @ORM\Column(name="is_overridable", type="boolean")
  320.      */
  321.     protected $overridable false;
  322.     
  323.     /**
  324.      * @ORM\Column(name="report_printed", type="boolean")
  325.      */
  326.     protected $reportPrinted false;
  327.     
  328.     /**
  329.      * @ORM\Column(name="processed", type="boolean")
  330.      */
  331.     protected $processed false;
  332.     /**
  333.      * @ORM\Column(name="closed_on_portal", type="boolean")
  334.      */
  335.     protected $closedOnPortal false;
  336.     
  337.     /**
  338.      * @ORM\Column(name="notes", type="text", nullable=true)
  339.      */
  340.     protected $notes null;
  341.     // ManyToOne
  342.         /**
  343.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Supplier", inversedBy="tickets")
  344.          * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id")
  345.          */
  346.         private $supplier;
  347.         /**
  348.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Client", inversedBy="tickets")
  349.          * @ORM\JoinColumn(name="client_id", referencedColumnName="id")
  350.          */
  351.         private $client;
  352.         /**
  353.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Operation", inversedBy="tickets")
  354.          * @ORM\JoinColumn(name="operation_id", referencedColumnName="id")
  355.          */
  356.         private $operation;
  357.         /**
  358.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\User", inversedBy="tickets")
  359.          * @ORM\JoinColumn(name="technician_id", referencedColumnName="id")
  360.          */
  361.         private $technician;
  362.         /**
  363.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\TicketStatus", inversedBy="tickets")
  364.          * @ORM\JoinColumn(name="status_id", referencedColumnName="id")
  365.          */
  366.         private $status;
  367.         
  368.         /**
  369.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Termid", inversedBy="tickets")
  370.          * @ORM\JoinColumn(name="termid_id", referencedColumnName="id")
  371.          */
  372.         private $termid;
  373.         
  374.         /**
  375.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationTariffAmount", inversedBy="tickets")
  376.          * @ORM\JoinColumn(name="operation_tariff_amount_id", referencedColumnName="id")
  377.          */
  378.         private $operationTariffAmount;
  379.                 
  380.         /**
  381.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationTariffAmount", inversedBy="uavTickets")
  382.          * @ORM\JoinColumn(name="uav_operation_tariff_amount_id", referencedColumnName="id")
  383.          */
  384.         private $uavOperationTariffAmount;
  385.     //
  386.     // OneToMany
  387.         /**
  388.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketSuspension", mappedBy="ticket")
  389.          */
  390.         private $suspensions;
  391.         /**
  392.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Intervention", mappedBy="ticket")
  393.          */
  394.         private $interventions;
  395.         
  396.         /**
  397.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketReminder", mappedBy="ticket")
  398.          */
  399.         private $reminders;
  400.         
  401.         /**
  402.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\TicketLog", mappedBy="ticket")
  403.          */
  404.         private $logs;
  405.     //
  406.     // ManyToMany
  407.         /**
  408.          * @ORM\ManyToMany(targetEntity="App\Entity\Slave\TicketTag", mappedBy="tickets")
  409.          */
  410.         private $ticketTags;
  411.     //
  412.     public function __construct()
  413.     {
  414.         $this->suspensions = new ArrayCollection();
  415.         $this->interventions = new ArrayCollection();
  416.         $this->reminders = new ArrayCollection();
  417.         $this->logs = new ArrayCollection();
  418.         $this->ticketTags = new ArrayCollection();
  419.     }
  420.     public function getId(): ?string
  421.     {
  422.         return $this->id;
  423.     }
  424.     public function getNumber(): ?string
  425.     {
  426.         return $this->number;
  427.     }
  428.     public function setNumber(?string $number): static
  429.     {
  430.         $this->number $number;
  431.         return $this;
  432.     }
  433.     public function getDatetimeImport(): ?\DateTimeInterface
  434.     {
  435.         return $this->datetimeImport;
  436.     }
  437.     public function setDatetimeImport(?\DateTimeInterface $datetimeImport): static
  438.     {
  439.         $this->datetimeImport $datetimeImport;
  440.         return $this;
  441.     }
  442.     public function getDatetimeStart(): ?\DateTimeInterface
  443.     {
  444.         return $this->datetimeStart;
  445.     }
  446.     public function setDatetimeStart(?\DateTimeInterface $datetimeStart): static
  447.     {
  448.         $this->datetimeStart $datetimeStart;
  449.         return $this;
  450.     }
  451.     public function getDatetimeExpiration(): ?\DateTimeInterface
  452.     {
  453.         return $this->datetimeExpiration;
  454.     }
  455.     public function setDatetimeExpiration(?\DateTimeInterface $datetimeExpiration): static
  456.     {
  457.         $this->datetimeExpiration $datetimeExpiration;
  458.         return $this;
  459.     }
  460.     public function getDatetimeEnd(): ?\DateTimeInterface
  461.     {
  462.         return $this->datetimeEnd;
  463.     }
  464.     public function setDatetimeEnd(?\DateTimeInterface $datetimeEnd): static
  465.     {
  466.         $this->datetimeEnd $datetimeEnd;
  467.         return $this;
  468.     }
  469.     public function getAddress(): ?string
  470.     {
  471.         return $this->address;
  472.     }
  473.     public function setAddress(?string $address): static
  474.     {
  475.         $this->address $address;
  476.         return $this;
  477.     }
  478.     public function getLocality(): ?string
  479.     {
  480.         return $this->locality;
  481.     }
  482.     public function setLocality(?string $locality): static
  483.     {
  484.         $this->locality $locality;
  485.         return $this;
  486.     }
  487.     public function getZip(): ?string
  488.     {
  489.         return $this->zip;
  490.     }
  491.     public function setZip(?string $zip): static
  492.     {
  493.         $this->zip $zip;
  494.         return $this;
  495.     }
  496.     public function getIdCity(): ?string
  497.     {
  498.         return $this->idCity;
  499.     }
  500.     public function setIdCity(?string $idCity): static
  501.     {
  502.         $this->idCity $idCity;
  503.         return $this;
  504.     }
  505.     public function getIdProvince(): ?string
  506.     {
  507.         return $this->idProvince;
  508.     }
  509.     public function setIdProvince(?string $idProvince): static
  510.     {
  511.         $this->idProvince $idProvince;
  512.         return $this;
  513.     }
  514.     public function getOtherCity(): ?string
  515.     {
  516.         return $this->otherCity;
  517.     }
  518.     public function setOtherCity(?string $otherCity): static
  519.     {
  520.         $this->otherCity $otherCity;
  521.         return $this;
  522.     }
  523.     public function isSystemError(): ?bool
  524.     {
  525.         return $this->systemError;
  526.     }
  527.     public function setSystemError(bool $systemError): static
  528.     {
  529.         $this->systemError $systemError;
  530.         return $this;
  531.     }
  532.     public function getSystemErrorSlug(): ?string
  533.     {
  534.         return $this->systemErrorSlug;
  535.     }
  536.     public function setSystemErrorSlug(?string $systemErrorSlug): static
  537.     {
  538.         $this->systemErrorSlug $systemErrorSlug;
  539.         return $this;
  540.     }
  541.     public function getSystemErrorDetails(): ?string
  542.     {
  543.         return $this->systemErrorDetails;
  544.     }
  545.     public function setSystemErrorDetails(?string $systemErrorDetails): static
  546.     {
  547.         $this->systemErrorDetails $systemErrorDetails;
  548.         return $this;
  549.     }
  550.     public function getJson(): ?string
  551.     {
  552.         return $this->json;
  553.     }
  554.     public function setJson(?string $json): static
  555.     {
  556.         $this->json $json;
  557.         return $this;
  558.     }
  559.     public function getDirectoryPath(): ?string
  560.     {
  561.         return $this->directoryPath;
  562.     }
  563.     public function setDirectoryPath(string $directoryPath): static
  564.     {
  565.         $this->directoryPath $directoryPath;
  566.         return $this;
  567.     }
  568.     public function getWaybill(): ?string
  569.     {
  570.         return $this->waybill;
  571.     }
  572.     public function setWaybill(?string $waybill): static
  573.     {
  574.         $this->waybill $waybill;
  575.         return $this;
  576.     }
  577.     public function isBillable(): ?bool
  578.     {
  579.         return $this->billable;
  580.     }
  581.     public function setBillable(bool $billable): static
  582.     {
  583.         $this->billable $billable;
  584.         return $this;
  585.     }
  586.     public function isOverridable(): ?bool
  587.     {
  588.         return $this->overridable;
  589.     }
  590.     public function setOverridable(bool $overridable): static
  591.     {
  592.         $this->overridable $overridable;
  593.         return $this;
  594.     }
  595.     public function getJsonReport(): ?string
  596.     {
  597.         return $this->jsonReport;
  598.     }
  599.     public function setJsonReport(?string $jsonReport): static
  600.     {
  601.         $this->jsonReport $jsonReport;
  602.         return $this;
  603.     }
  604.     public function isReportPrinted(): ?bool
  605.     {
  606.         return $this->reportPrinted;
  607.     }
  608.     public function setReportPrinted(bool $reportPrinted): static
  609.     {
  610.         $this->reportPrinted $reportPrinted;
  611.         return $this;
  612.     }
  613.     public function isProcessed(): ?bool
  614.     {
  615.         return $this->processed;
  616.     }
  617.     public function setProcessed(bool $processed): static
  618.     {
  619.         $this->processed $processed;
  620.         return $this;
  621.     }
  622.     public function isClosedOnPortal(): ?bool
  623.     {
  624.         return $this->closedOnPortal;
  625.     }
  626.     public function setClosedOnPortal(bool $closedOnPortal): static
  627.     {
  628.         $this->closedOnPortal $closedOnPortal;
  629.         return $this;
  630.     }
  631.     public function getNotes(): ?string
  632.     {
  633.         return $this->notes;
  634.     }
  635.     public function setNotes(?string $notes): static
  636.     {
  637.         $this->notes $notes;
  638.         return $this;
  639.     }
  640.     public function getSupplier(): ?Supplier
  641.     {
  642.         return $this->supplier;
  643.     }
  644.     public function setSupplier(?Supplier $supplier): static
  645.     {
  646.         $this->supplier $supplier;
  647.         return $this;
  648.     }
  649.     public function getClient(): ?Client
  650.     {
  651.         return $this->client;
  652.     }
  653.     public function setClient(?Client $client): static
  654.     {
  655.         $this->client $client;
  656.         return $this;
  657.     }
  658.     public function getOperation(): ?Operation
  659.     {
  660.         return $this->operation;
  661.     }
  662.     public function setOperation(?Operation $operation): static
  663.     {
  664.         $this->operation $operation;
  665.         return $this;
  666.     }
  667.     public function getTechnician(): ?User
  668.     {
  669.         return $this->technician;
  670.     }
  671.     public function setTechnician(?User $technician): static
  672.     {
  673.         $this->technician $technician;
  674.         return $this;
  675.     }
  676.     public function getStatus(): ?TicketStatus
  677.     {
  678.         return $this->status;
  679.     }
  680.     public function setStatus(?TicketStatus $status): static
  681.     {
  682.         $this->status $status;
  683.         return $this;
  684.     }
  685.     public function getTermid(): ?Termid
  686.     {
  687.         return $this->termid;
  688.     }
  689.     public function setTermid(?Termid $termid): static
  690.     {
  691.         $this->termid $termid;
  692.         return $this;
  693.     }
  694.     public function getOperationTariffAmount(): ?OperationTariffAmount
  695.     {
  696.         return $this->operationTariffAmount;
  697.     }
  698.     public function setOperationTariffAmount(?OperationTariffAmount $operationTariffAmount): static
  699.     {
  700.         $this->operationTariffAmount $operationTariffAmount;
  701.         return $this;
  702.     }
  703.     public function getUavOperationTariffAmount(): ?OperationTariffAmount
  704.     {
  705.         return $this->uavOperationTariffAmount;
  706.     }
  707.     public function setUavOperationTariffAmount(?OperationTariffAmount $uavOperationTariffAmount): static
  708.     {
  709.         $this->uavOperationTariffAmount $uavOperationTariffAmount;
  710.         return $this;
  711.     }
  712.     /**
  713.      * @return Collection<int, TicketSuspension>
  714.      */
  715.     public function getSuspensions(): Collection
  716.     {
  717.         return $this->suspensions;
  718.     }
  719.     public function addSuspension(TicketSuspension $suspension): static
  720.     {
  721.         if (!$this->suspensions->contains($suspension)) {
  722.             $this->suspensions->add($suspension);
  723.             $suspension->setTicket($this);
  724.         }
  725.         return $this;
  726.     }
  727.     public function removeSuspension(TicketSuspension $suspension): static
  728.     {
  729.         if ($this->suspensions->removeElement($suspension)) {
  730.             // set the owning side to null (unless already changed)
  731.             if ($suspension->getTicket() === $this) {
  732.                 $suspension->setTicket(null);
  733.             }
  734.         }
  735.         return $this;
  736.     }
  737.     /**
  738.      * @return Collection<int, Intervention>
  739.      */
  740.     public function getInterventions(): Collection
  741.     {
  742.         return $this->interventions;
  743.     }
  744.     public function addIntervention(Intervention $intervention): static
  745.     {
  746.         if (!$this->interventions->contains($intervention)) {
  747.             $this->interventions->add($intervention);
  748.             $intervention->setTicket($this);
  749.         }
  750.         return $this;
  751.     }
  752.     public function removeIntervention(Intervention $intervention): static
  753.     {
  754.         if ($this->interventions->removeElement($intervention)) {
  755.             // set the owning side to null (unless already changed)
  756.             if ($intervention->getTicket() === $this) {
  757.                 $intervention->setTicket(null);
  758.             }
  759.         }
  760.         return $this;
  761.     }
  762.     /**
  763.      * @return Collection<int, TicketReminder>
  764.      */
  765.     public function getReminders(): Collection
  766.     {
  767.         return $this->reminders;
  768.     }
  769.     public function addReminder(TicketReminder $reminder): static
  770.     {
  771.         if (!$this->reminders->contains($reminder)) {
  772.             $this->reminders->add($reminder);
  773.             $reminder->setTicket($this);
  774.         }
  775.         return $this;
  776.     }
  777.     public function removeReminder(TicketReminder $reminder): static
  778.     {
  779.         if ($this->reminders->removeElement($reminder)) {
  780.             // set the owning side to null (unless already changed)
  781.             if ($reminder->getTicket() === $this) {
  782.                 $reminder->setTicket(null);
  783.             }
  784.         }
  785.         return $this;
  786.     }
  787.     /**
  788.      * @return Collection<int, TicketLog>
  789.      */
  790.     public function getLogs(): Collection
  791.     {
  792.         return $this->logs;
  793.     }
  794.     public function addLog(TicketLog $log): static
  795.     {
  796.         if (!$this->logs->contains($log)) {
  797.             $this->logs->add($log);
  798.             $log->setTicket($this);
  799.         }
  800.         return $this;
  801.     }
  802.     public function removeLog(TicketLog $log): static
  803.     {
  804.         if ($this->logs->removeElement($log)) {
  805.             // set the owning side to null (unless already changed)
  806.             if ($log->getTicket() === $this) {
  807.                 $log->setTicket(null);
  808.             }
  809.         }
  810.         return $this;
  811.     }
  812.     /**
  813.      * @return Collection<int, TicketTag>
  814.      */
  815.     public function getTicketTags(): Collection
  816.     {
  817.         return $this->ticketTags;
  818.     }
  819.     public function addTicketTag(TicketTag $ticketTag): static
  820.     {
  821.         if (!$this->ticketTags->contains($ticketTag)) {
  822.             $this->ticketTags->add($ticketTag);
  823.             $ticketTag->addTicket($this);
  824.         }
  825.         return $this;
  826.     }
  827.     public function removeTicketTag(TicketTag $ticketTag): static
  828.     {
  829.         if ($this->ticketTags->removeElement($ticketTag)) {
  830.             $ticketTag->removeTicket($this);
  831.         }
  832.         return $this;
  833.     }
  834.     
  835. }