src/Entity/ComptaType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ComptaTypeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ComptaTypeRepository::class)
  9. */
  10. class ComptaType
  11. {
  12. const REDUCTION = "reduction";
  13. const ADHESION = "Frais Adhésion";
  14. /**
  15. * @ORM\Id
  16. * @ORM\GeneratedValue
  17. * @ORM\Column(type="integer")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="string", length=255)
  22. */
  23. private $name;
  24. /**
  25. * @ORM\OneToMany(targetEntity=Compta::class, mappedBy="comptaType")
  26. */
  27. private $comptas;
  28. /**
  29. * @ORM\Column(type="string", length=255)
  30. */
  31. private $typeOperation;
  32. public function __construct()
  33. {
  34. $this->comptas = new ArrayCollection();
  35. }
  36. public function getId(): ?int
  37. {
  38. return $this->id;
  39. }
  40. public function getName(): ?string
  41. {
  42. return $this->name;
  43. }
  44. public function setName(string $name): self
  45. {
  46. $this->name = $name;
  47. return $this;
  48. }
  49. /**
  50. * @return Collection|Compta[]
  51. */
  52. public function getComptas(): Collection
  53. {
  54. return $this->comptas;
  55. }
  56. public function addCompta(Compta $compta): self
  57. {
  58. if (!$this->comptas->contains($compta)) {
  59. $this->comptas[] = $compta;
  60. $compta->setComptaType($this);
  61. }
  62. return $this;
  63. }
  64. public function removeCompta(Compta $compta): self
  65. {
  66. if ($this->comptas->removeElement($compta)) {
  67. // set the owning side to null (unless already changed)
  68. if ($compta->getComptaType() === $this) {
  69. $compta->setComptaType(null);
  70. }
  71. }
  72. return $this;
  73. }
  74. public function getTypeOperation(): ?string
  75. {
  76. return $this->typeOperation;
  77. }
  78. public function setTypeOperation(string $typeOperation): self
  79. {
  80. $this->typeOperation = $typeOperation;
  81. return $this;
  82. }
  83. }