<?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;
    }
}
