| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?php
- namespace AppBundle\Entity\Core;
- use AppBundle\Entity\AccessAndFunction\Access;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- use AppBundle\Annotation\DefaultField;
- use Doctrine\ORM\Mapping as ORM;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * Fais le lien entre une Notification et un Access
- */
- #[ORM\Entity]
- class NotificationUser
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['notificationuser'])]
- private $id;
- /**
- * @var Notification
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\Core\AbstractInformation', inversedBy: 'notificationUsers')]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['notificationuser'])]
- private $notification;
- /**
- * @var Access
- *
- * @DefaultField
- */
- #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'notificationUsers')]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['notificationuser'])]
- private $access;
- /**
- * @var boolean
- */
- #[ORM\Column(type: 'boolean', options: ['default' => 0])]
- #[Assert\Type(type: 'boolean')]
- #[Groups(['notificationuser'])]
- private $isRead = 0;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set isRead
- *
- * @param boolean $isRead
- *
- * @return NotificationUser
- */
- public function setIsRead($isRead)
- {
- $this->isRead = $isRead;
- return $this;
- }
- /**
- * Get isRead
- *
- * @return boolean
- */
- public function getIsRead()
- {
- return $this->isRead;
- }
- /**
- * Set notification
- *
- * @param AbstractInformation $notification
- *
- * @return NotificationUser
- */
- public function setNotification(AbstractInformation $notification)
- {
- $this->notification = $notification;
- return $this;
- }
- /**
- * Get notification
- *
- * @return Notification
- */
- public function getNotification()
- {
- return $this->notification;
- }
- /**
- * Set access
- *
- * @param Access $access
- *
- * @return NotificationUser
- */
- public function setAccess(Access $access)
- {
- $this->access = $access;
- return $this;
- }
- /**
- * Get access
- *
- * @return Access
- */
- public function getAccess()
- {
- return $this->access;
- }
- }
|