vendor/sulu/sulu/src/Sulu/Bundle/ContactBundle/Entity/Note.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of Sulu.
  4. *
  5. * (c) Sulu GmbH
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Sulu\Bundle\ContactBundle\Entity;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use JMS\Serializer\Annotation\Exclude;
  14. use JMS\Serializer\Annotation\Groups;
  15. /**
  16. * Note.
  17. */
  18. class Note
  19. {
  20. /**
  21. * @var string
  22. */
  23. #[Groups(['fullAccount', 'fullContact'])]
  24. private $value;
  25. /**
  26. * @var int
  27. */
  28. #[Groups(['fullAccount', 'fullContact'])]
  29. private $id;
  30. /**
  31. * @var Collection<int, ContactInterface>
  32. */
  33. #[Exclude]
  34. private $contacts;
  35. /**
  36. * @var Collection<int, AccountInterface>
  37. */
  38. #[Exclude]
  39. private $accounts;
  40. /**
  41. * Constructor.
  42. */
  43. public function __construct()
  44. {
  45. $this->contacts = new ArrayCollection();
  46. $this->accounts = new ArrayCollection();
  47. }
  48. /**
  49. * Set value.
  50. *
  51. * @param string $value
  52. *
  53. * @return Note
  54. */
  55. public function setValue($value)
  56. {
  57. $this->value = $value;
  58. return $this;
  59. }
  60. /**
  61. * Get value.
  62. *
  63. * @return string
  64. */
  65. public function getValue()
  66. {
  67. return $this->value;
  68. }
  69. /**
  70. * Get id.
  71. *
  72. * @return int
  73. */
  74. public function getId()
  75. {
  76. return $this->id;
  77. }
  78. /**
  79. * Add contacts.
  80. *
  81. * @return Note
  82. */
  83. public function addContact(ContactInterface $contacts)
  84. {
  85. $this->contacts[] = $contacts;
  86. return $this;
  87. }
  88. /**
  89. * Remove contacts.
  90. */
  91. public function removeContact(ContactInterface $contacts)
  92. {
  93. $this->contacts->removeElement($contacts);
  94. }
  95. /**
  96. * Get contacts.
  97. *
  98. * @return Collection<int, ContactInterface>
  99. */
  100. public function getContacts()
  101. {
  102. return $this->contacts;
  103. }
  104. /**
  105. * Add accounts.
  106. *
  107. * @return Note
  108. */
  109. public function addAccount(AccountInterface $account)
  110. {
  111. $this->accounts[] = $account;
  112. return $this;
  113. }
  114. /**
  115. * Remove accounts.
  116. */
  117. public function removeAccount(AccountInterface $account)
  118. {
  119. $this->accounts->removeElement($account);
  120. }
  121. /**
  122. * Get accounts.
  123. *
  124. * @return Collection<int, AccountInterface>
  125. */
  126. public function getAccounts()
  127. {
  128. return $this->accounts;
  129. }
  130. }