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.         public function getId(): ?string
  71.         {
  72.             return $this->id;
  73.         }
  74.         public function getValue(): ?string
  75.         {
  76.             return $this->value;
  77.         }
  78.         public function setValue(string $value): static
  79.         {
  80.             $this->value $value;
  81.             return $this;
  82.         }
  83.         public function getAmount(): ?string
  84.         {
  85.             return $this->amount;
  86.         }
  87.         public function setAmount(string $amount): static
  88.         {
  89.             $this->amount $amount;
  90.             return $this;
  91.         }
  92.         public function isStandard(): ?bool
  93.         {
  94.             return $this->standard;
  95.         }
  96.         public function setStandard(bool $standard): static
  97.         {
  98.             $this->standard $standard;
  99.             return $this;
  100.         }
  101.         public function getTariff(): ?OperationTariff
  102.         {
  103.             return $this->tariff;
  104.         }
  105.         public function setTariff(?OperationTariff $tariff): static
  106.         {
  107.             $this->tariff $tariff;
  108.             return $this;
  109.         }
  110.         public function getAlgorithm(): ?OperationAlgorithm
  111.         {
  112.             return $this->algorithm;
  113.         }
  114.         public function setAlgorithm(?OperationAlgorithm $algorithm): static
  115.         {
  116.             $this->algorithm $algorithm;
  117.             return $this;
  118.         }
  119.         /**
  120.          * @return Collection<int, JoinTableTechnicianAreaOperationTariffAmount>
  121.          */
  122.         public function getTechnicianAreas(): Collection
  123.         {
  124.             return $this->technicianAreas;
  125.         }
  126.         public function addTechnicianArea(JoinTableTechnicianAreaOperationTariffAmount $technicianArea): static
  127.         {
  128.             if (!$this->technicianAreas->contains($technicianArea)) {
  129.                 $this->technicianAreas->add($technicianArea);
  130.                 $technicianArea->setOperationTariffAmount($this);
  131.             }
  132.             return $this;
  133.         }
  134.         public function removeTechnicianArea(JoinTableTechnicianAreaOperationTariffAmount $technicianArea): static
  135.         {
  136.             if ($this->technicianAreas->removeElement($technicianArea)) {
  137.                 // set the owning side to null (unless already changed)
  138.                 if ($technicianArea->getOperationTariffAmount() === $this) {
  139.                     $technicianArea->setOperationTariffAmount(null);
  140.                 }
  141.             }
  142.             return $this;
  143.         }
  144.         /**
  145.          * @return Collection<int, Ticket>
  146.          */
  147.         public function getTickets(): Collection
  148.         {
  149.             return $this->tickets;
  150.         }
  151.         public function addTicket(Ticket $ticket): static
  152.         {
  153.             if (!$this->tickets->contains($ticket)) {
  154.                 $this->tickets->add($ticket);
  155.                 $ticket->setOperationTariffAmount($this);
  156.             }
  157.             return $this;
  158.         }
  159.         public function removeTicket(Ticket $ticket): static
  160.         {
  161.             if ($this->tickets->removeElement($ticket)) {
  162.                 // set the owning side to null (unless already changed)
  163.                 if ($ticket->getOperationTariffAmount() === $this) {
  164.                     $ticket->setOperationTariffAmount(null);
  165.                 }
  166.             }
  167.             return $this;
  168.         }
  169.         /**
  170.          * @return Collection<int, Ticket>
  171.          */
  172.         public function getUavTickets(): Collection
  173.         {
  174.             return $this->uavTickets;
  175.         }
  176.         public function addUavTicket(Ticket $uavTicket): static
  177.         {
  178.             if (!$this->uavTickets->contains($uavTicket)) {
  179.                 $this->uavTickets->add($uavTicket);
  180.                 $uavTicket->setUavOperationTariffAmount($this);
  181.             }
  182.             return $this;
  183.         }
  184.         public function removeUavTicket(Ticket $uavTicket): static
  185.         {
  186.             if ($this->uavTickets->removeElement($uavTicket)) {
  187.                 // set the owning side to null (unless already changed)
  188.                 if ($uavTicket->getUavOperationTariffAmount() === $this) {
  189.                     $uavTicket->setUavOperationTariffAmount(null);
  190.                 }
  191.             }
  192.             return $this;
  193.         }
  194. }