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.      */
  25.     private $value;
  26.     /**
  27.      * @var int
  28.      *
  29.      * @Groups({"fullAccount", "fullContact"})
  30.      */
  31.     private $id;
  32.     /**
  33.      * @var Collection<int, ContactInterface>
  34.      *
  35.      * @Exclude
  36.      */
  37.     private $contacts;
  38.     /**
  39.      * @var Collection<int, AccountInterface>
  40.      *
  41.      * @Exclude
  42.      */
  43.     private $accounts;
  44.     /**
  45.      * Constructor.
  46.      */
  47.     public function __construct()
  48.     {
  49.         $this->contacts = new ArrayCollection();
  50.         $this->accounts = new ArrayCollection();
  51.     }
  52.     /**
  53.      * Set value.
  54.      *
  55.      * @param string $value
  56.      *
  57.      * @return Note
  58.      */
  59.     public function setValue($value)
  60.     {
  61.         $this->value $value;
  62.         return $this;
  63.     }
  64.     /**
  65.      * Get value.
  66.      *
  67.      * @return string
  68.      */
  69.     public function getValue()
  70.     {
  71.         return $this->value;
  72.     }
  73.     /**
  74.      * Get id.
  75.      *
  76.      * @return int
  77.      */
  78.     public function getId()
  79.     {
  80.         return $this->id;
  81.     }
  82.     /**
  83.      * Add contacts.
  84.      *
  85.      * @return Note
  86.      */
  87.     public function addContact(ContactInterface $contacts)
  88.     {
  89.         $this->contacts[] = $contacts;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Remove contacts.
  94.      */
  95.     public function removeContact(ContactInterface $contacts)
  96.     {
  97.         $this->contacts->removeElement($contacts);
  98.     }
  99.     /**
  100.      * Get contacts.
  101.      *
  102.      * @return Collection<int, ContactInterface>
  103.      */
  104.     public function getContacts()
  105.     {
  106.         return $this->contacts;
  107.     }
  108.     /**
  109.      * Add accounts.
  110.      *
  111.      * @return Note
  112.      */
  113.     public function addAccount(AccountInterface $account)
  114.     {
  115.         $this->accounts[] = $account;
  116.         return $this;
  117.     }
  118.     /**
  119.      * Remove accounts.
  120.      */
  121.     public function removeAccount(AccountInterface $account)
  122.     {
  123.         $this->accounts->removeElement($account);
  124.     }
  125.     /**
  126.      * Get accounts.
  127.      *
  128.      * @return Collection<int, AccountInterface>
  129.      */
  130.     public function getAccounts()
  131.     {
  132.         return $this->accounts;
  133.     }
  134. }