src/Entity/Clientrelation.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * Clientrelation
  8. *
  9. * @ORM\Table(name="clientrelation", options={"collate"="latin1_general_ci","charset"="latin1"})
  10. * @ORM\Entity(repositoryClass="App\Repository\ClientrelationRepository")
  11. */
  12. class Clientrelation
  13. {
  14. /**
  15. * @var integer
  16. *
  17. * @ORM\Column(name="id", type="integer", nullable=false)
  18. * @ORM\Id
  19. * @ORM\GeneratedValue(strategy="IDENTITY")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\ManyToOne(targetEntity="App\Entity\Fournisseur", cascade={"persist"}, inversedBy="clientRelation")
  24. * @ORM\JoinColumn(nullable=false)
  25. */
  26. private $idfournisseur;
  27. /**
  28. * @ORM\ManyToOne(targetEntity="App\Entity\Client", cascade={"persist"}, inversedBy="clientRelation")
  29. * @ORM\JoinColumn(nullable=false)
  30. */
  31. private $idclient;
  32. /**
  33. * @var string
  34. *
  35. * @ORM\Column(name="code", type="string", length=50, nullable=false)
  36. */
  37. private $code;
  38. /**
  39. * @ORM\Column(type="string", nullable=true)
  40. */
  41. private $signatureRequestId;
  42. /**
  43. * @ORM\Column(type="string", length=255, nullable=true, name="document_id")
  44. */
  45. private $documentId;
  46. /**
  47. * @ORM\OneToMany(targetEntity="App\Entity\FournisseurClientdocument", mappedBy="idrelation", cascade={"persist", "remove"})
  48. */
  49. private $documents;
  50. public function getDocuments(): Collection
  51. {
  52. return $this->documents;
  53. }
  54. public function addDocument(FournisseurClientdocument $document): self
  55. {
  56. if (!$this->documents->contains($document)) {
  57. $this->documents[] = $document;
  58. $document->setIdrelation($this);
  59. }
  60. return $this;
  61. }
  62. public function removeDocument(FournisseurClientdocument $document): self
  63. {
  64. if ($this->documents->contains($document)) {
  65. $this->documents->removeElement($document);
  66. // Si nécessaire, dissocier l'entité
  67. if ($document->getIdrelation() === $this) {
  68. $document->setIdrelation(null);
  69. }
  70. }
  71. return $this;
  72. }
  73. public function getDocumentId()
  74. {
  75. return $this->documentId;
  76. }
  77. public function setDocumentId($documentId)
  78. {
  79. $this->documentId = $documentId;
  80. }
  81. public function getSignatureRequestId()
  82. {
  83. return $this->signatureRequestId;
  84. }
  85. public function setSignatureRequestId($signatureRequestId)
  86. {
  87. $this->signatureRequestId = $signatureRequestId;
  88. }
  89. /**
  90. * Get id
  91. *
  92. * @return integer
  93. */
  94. public function getId()
  95. {
  96. return $this->id;
  97. }
  98. /**
  99. * Set code
  100. *
  101. * @param string $code
  102. * @return Clientrelation
  103. */
  104. public function setCode($code)
  105. {
  106. $this->code = $code;
  107. return $this;
  108. }
  109. /**
  110. * Get code
  111. *
  112. * @return string
  113. */
  114. public function getCode()
  115. {
  116. return $this->code;
  117. }
  118. /**
  119. * Set idfournisseur
  120. *
  121. * @param Fournisseur $idfournisseur
  122. * @return Clientrelation
  123. */
  124. public function setIdfournisseur(Fournisseur $idfournisseur)
  125. {
  126. $this->idfournisseur = $idfournisseur;
  127. return $this;
  128. }
  129. /**
  130. * Get idfournisseur
  131. *
  132. * @return Fournisseur
  133. */
  134. public function getIdfournisseur()
  135. {
  136. return $this->idfournisseur;
  137. }
  138. /**
  139. * Set idclient
  140. *
  141. * @param Client $idclient
  142. * @return Clientrelation
  143. */
  144. public function setIdclient(Client $idclient)
  145. {
  146. $this->idclient = $idclient;
  147. return $this;
  148. }
  149. /**
  150. * Get idclient
  151. *
  152. * @return Client
  153. */
  154. public function getIdclient()
  155. {
  156. return $this->idclient;
  157. }
  158. }