src/Entity/Slave/OperationTariffAmount.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_operation_tariff_amount")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Slave\OperationTariffAmountRepository")
  10.  */
  11. class OperationTariffAmount
  12. {
  13.     public function displayValueAndAmount()
  14.     {
  15.         return $this->getValue().' ('.$this->getAmount().' €)';
  16.     }
  17.     /**
  18.      * @ORM\Column(name="id", type="bigint")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     protected $id;
  23.     
  24.     /**
  25.      * @ORM\Column(name="value", type="string", length=191)
  26.      */
  27.     protected $value;
  28.     /**
  29.      * @ORM\Column(name="amount", type="decimal", scale=2)
  30.      */
  31.     protected $amount;
  32.     
  33.     /**
  34.      * @ORM\Column(name="is_standard", type="boolean")
  35.      */
  36.     protected $standard false;
  37.         
  38.     // ManyToOne
  39.         /**
  40.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationTariff", inversedBy="amounts")
  41.          * @ORM\JoinColumn(name="operation_tariff_id", referencedColumnName="id")
  42.          */
  43.         private $tariff;
  44.         
  45.         /**
  46.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\OperationAlgorithm", inversedBy="amounts")
  47.          * @ORM\JoinColumn(name="operation_algorithm_id", referencedColumnName="id")
  48.          */
  49.         private $algorithm;
  50.     //
  51.     // OneToMany
  52.         /**
  53.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\JoinTableTechnicianAreaOperationTariffAmount", mappedBy="operationTariffAmount")
  54.          */
  55.         private $technicianAreas;
  56.         /**
  57.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Ticket", mappedBy="operationTariffAmount")
  58.          */
  59.         private $tickets;
  60.         /**
  61.          * @ORM\OneToMany(targetEntity="App\Entity\Slave\Ticket", mappedBy="uavOperationTariffAmount")
  62.          */
  63.         private $uavTickets;
  64.         public function __construct()
  65.         {
  66.             $this->technicianAreas = new ArrayCollection();
  67.             $this->tickets = new ArrayCollection();
  68.             $this->uavTickets = new ArrayCollection();
  69.         }
  70.     //
  71.     public function getId(): ?string
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getValue(): ?string
  76.     {
  77.         return $this->value;
  78.     }
  79.     public function setValue(string $value): self
  80.     {
  81.         $this->value $value;
  82.         return $this;
  83.     }
  84.     public function getAmount(): ?string
  85.     {
  86.         return $this->amount;
  87.     }
  88.     public function setAmount(string $amount): self
  89.     {
  90.         $this->amount $amount;
  91.         return $this;
  92.     }
  93.     public function isStandard(): ?bool
  94.     {
  95.         return $this->standard;
  96.     }
  97.     public function setStandard(bool $standard): self
  98.     {
  99.         $this->standard $standard;
  100.         return $this;
  101.     }
  102.     public function getTariff(): ?OperationTariff
  103.     {
  104.         return $this->tariff;
  105.     }
  106.     public function setTariff(?OperationTariff $tariff): self
  107.     {
  108.         $this->tariff $tariff;
  109.         return $this;
  110.     }
  111.     public function getAlgorithm(): ?OperationAlgorithm
  112.     {
  113.         return $this->algorithm;
  114.     }
  115.     public function setAlgorithm(?OperationAlgorithm $algorithm): self
  116.     {
  117.         $this->algorithm $algorithm;
  118.         return $this;
  119.     }
  120.     /**
  121.      * @return Collection<int, JoinTableTechnicianAreaOperationTariffAmount>
  122.      */
  123.     public function getTechnicianAreas(): Collection
  124.     {
  125.         return $this->technicianAreas;
  126.     }
  127.     public function addTechnicianArea(JoinTableTechnicianAreaOperationTariffAmount $technicianArea): self
  128.     {
  129.         if (!$this->technicianAreas->contains($technicianArea)) {
  130.             $this->technicianAreas->add($technicianArea);
  131.             $technicianArea->setOperationTariffAmount($this);
  132.         }
  133.         return $this;
  134.     }
  135.     public function removeTechnicianArea(JoinTableTechnicianAreaOperationTariffAmount $technicianArea): self
  136.     {
  137.         if ($this->technicianAreas->removeElement($technicianArea)) {
  138.             // set the owning side to null (unless already changed)
  139.             if ($technicianArea->getOperationTariffAmount() === $this) {
  140.                 $technicianArea->setOperationTariffAmount(null);
  141.             }
  142.         }
  143.         return $this;
  144.     }
  145.     /**
  146.      * @return Collection<int, Ticket>
  147.      */
  148.     public function getTickets(): Collection
  149.     {
  150.         return $this->tickets;
  151.     }
  152.     public function addTicket(Ticket $ticket): self
  153.     {
  154.         if (!$this->tickets->contains($ticket)) {
  155.             $this->tickets->add($ticket);
  156.             $ticket->setOperationTariffAmount($this);
  157.         }
  158.         return $this;
  159.     }
  160.     public function removeTicket(Ticket $ticket): self
  161.     {
  162.         if ($this->tickets->removeElement($ticket)) {
  163.             // set the owning side to null (unless already changed)
  164.             if ($ticket->getOperationTariffAmount() === $this) {
  165.                 $ticket->setOperationTariffAmount(null);
  166.             }
  167.         }
  168.         return $this;
  169.     }
  170.     /**
  171.      * @return Collection<int, Ticket>
  172.      */
  173.     public function getUavTickets(): Collection
  174.     {
  175.         return $this->uavTickets;
  176.     }
  177.     public function addUavTicket(Ticket $uavTicket): self
  178.     {
  179.         if (!$this->uavTickets->contains($uavTicket)) {
  180.             $this->uavTickets->add($uavTicket);
  181.             $uavTicket->setUavOperationTariffAmount($this);
  182.         }
  183.         return $this;
  184.     }
  185.     public function removeUavTicket(Ticket $uavTicket): self
  186.     {
  187.         if ($this->uavTickets->removeElement($uavTicket)) {
  188.             // set the owning side to null (unless already changed)
  189.             if ($uavTicket->getUavOperationTariffAmount() === $this) {
  190.                 $uavTicket->setUavOperationTariffAmount(null);
  191.             }
  192.         }
  193.         return $this;
  194.     }
  195. }