| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?php
- namespace AppBundle\Entity\Core;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\Common\Collections\ArrayCollection;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- use AppBundle\Entity\Organization\Organization;
- use AppBundle\Entity\AccessAndFunction\Access;
- /**
- * Notification
- *
- * @Iri("http://schema.org/Notification")
- */
- #[ORM\Entity(repositoryClass: 'AppBundle\Entity\Core\Repository\NotificationRepository')]
- class Notification extends AbstractInformation
- {
- /**
- * @var string
- */
- #[ORM\Column(type: 'json_array', nullable: false)]
- #[Assert\NotNull]
- #[Groups(['notification', 'notification_list'])]
- private $message;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 255, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['notification', 'notification_list'])]
- private $link;
- /**
- * @var Access
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'notifications')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['super_admin'])]
- private $recipientAccess;
- /**
- * @var Organization
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Organization\Organization', inversedBy: 'notifications')]
- #[ORM\JoinColumn(nullable: true)]
- #[Groups(['super_admin'])]
- private $recipientOrganization;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string')]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Assert\Choice(callback: ['\AppBundle\Enum\Core\NotificationTypeEnum', 'toArray'])]
- #[Groups(['notification', 'notification_list'])]
- private $type;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: true)]
- #[Assert\Date]
- #[Groups(['notification'])]
- private $availabilityDate;
- public function __construct() {
- }
- /**
- * Gets link.
- *
- * @return string
- */
- public function getLink() {
- return $this->link;
- }
- /**
- * Gets recipientAccess
- *
- * @return Access
- */
- public function getRecipientAccess() {
- return $this->recipientAccess;
- }
- /**
- * Gets recipientOrganization.
- *
- * @return Organization
- */
- public function getRecipientOrganization() {
- return $this->recipientOrganization;
- }
- /**
- * Sets link.
- *
- * @param string $link
- * @return $this
- */
- public function setLink($link) {
- $this->link = $link;
- return $this;
- }
- /**
- * Sets recipientAccess.
- *
- * @param Access $recipientAccess
- * @return $this
- */
- public function setRecipientAccess(Access $recipientAccess = null) {
- $this->recipientAccess = $recipientAccess;
- return $this;
- }
- /**
- * Sets recipientOrganization.
- *
- * @param Organization $recipientOrganization
- * @return $this
- */
- public function setRecipientOrganization(Organization $recipientOrganization = null) {
- $this->recipientOrganization = $recipientOrganization;
- return $this;
- }
- /**
- * Gets type.
- *
- * @return string
- */
- public function getType() {
- return $this->type;
- }
- /**
- * Sets type.
- *
- * @param string $type
- * @return $this
- */
- public function setType($type) {
- $this->type = $type;
- return $this;
- }
- /**
- * Set message
- *
- * @param array $message
- *
- * @return Notification
- */
- public function setMessage($message)
- {
- $this->message = $message;
- return $this;
- }
- /**
- * Get message
- *
- * @return array
- */
- public function getMessage()
- {
- return $this->message;
- }
- /**
- * Set availabilityDate
- *
- * @param \DateTime $availabilityDate
- *
- * @return Notification
- */
- public function setAvailabilityDate($availabilityDate)
- {
- $this->availabilityDate = $availabilityDate;
- return $this;
- }
- /**
- * Get availabilityDate
- *
- * @return \DateTime
- */
- public function getAvailabilityDate()
- {
- return $this->availabilityDate;
- }
- }
|