src/Entity/Notification.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\NotificationRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  9. use ApiPlatform\Metadata\ApiFilter;
  10. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  11. #[ApiResource(
  12.     normalizationContext: ['groups' => ['Notification:read']],
  13.     denormalizationContext: ['groups' => ['Notification:write']],
  14.     order: ['id' => 'DESC'],
  15. )]
  16. #[ApiFilter(SearchFilter::class, properties: [
  17.     'users.id' => 'exact',
  18.     'massiveNotification.id' => 'exact',
  19.     // 'userType' => 'exact',
  20.     // 'appPersonalAccounts.number' => 'exact',
  21. ])]
  22. class Notification
  23. {
  24.     #[Groups(['Notification:read''Notification:write'])]
  25.     #[ORM\Id]
  26.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  27.     #[ORM\Column]
  28.     private ?int $id null;
  29.     #[Groups(['Notification:read''Notification:write'])]
  30.     #[ORM\ManyToOne(inversedBy'notifications')]
  31.     private ?User $users null;
  32.     #[Groups(['Notification:read''Notification:write'])]
  33.     #[ORM\Column(length255)]
  34.     private ?string $title null;
  35.     #[Groups(['Notification:read''Notification:write'])]
  36.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  37.     private ?string $body null;
  38.     #[Groups(['Notification:read''Notification:write'])]
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $type null;
  41.     #[Groups(['Notification:read''Notification:write'])]
  42.     #[ORM\ManyToOne(inversedBy'notifications')]
  43.     private ?MediaObject $image null;
  44.     #[Groups(['Notification:read''Notification:write'])]
  45.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  46.     private ?\DateTimeInterface $dateEntered null;
  47.     #[Groups(['Notification:read''Notification:write'])]
  48.     #[ORM\Column(length100nullabletrue)]
  49.     private ?string $status null;
  50.     #[Groups(['Notification:read''Notification:write'])]
  51.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  52.     private ?string $error null;
  53.     #[Groups(['Notification:read''Notification:write'])]
  54.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  55.     private ?\DateTimeInterface $dateSend null;
  56.     #[Groups(['Notification:read''Notification:write'])]
  57.     #[ORM\Column(nullabletrue)]
  58.     private ?int $priority null;
  59.     #[Groups(['Notification:read''Notification:write'])]
  60.     #[ORM\Column(length100nullabletrue)]
  61.     private ?string $sender null;
  62.     #[Groups(['Notification:read''Notification:write'])]
  63.     #[ORM\Column(length100nullabletrue)]
  64.     private ?string $ns_msg_id null;
  65.     #[Groups(['Notification:read''Notification:write'])]
  66.     #[ORM\Column(nullabletrue)]
  67.     private ?bool $allUsers null;
  68.     #[Groups(['Notification:read''Notification:write'])]
  69.     #[ORM\Column(length100nullabletrue)]
  70.     private ?string $numberAccount null;
  71.     #[ORM\ManyToOne(inversedBy'notifications')]
  72.     private ?MassiveNotification $massiveNotification null;
  73.     public function getId(): ?int
  74.     {
  75.         return $this->id;
  76.     }
  77.     public function getUsers(): ?User
  78.     {
  79.         return $this->users;
  80.     }
  81.     public function setUsers(?User $users): static
  82.     {
  83.         $this->users $users;
  84.         return $this;
  85.     }
  86.     public function getTitle(): ?string
  87.     {
  88.         return $this->title;
  89.     }
  90.     public function setTitle(string $title): static
  91.     {
  92.         $this->title $title;
  93.         return $this;
  94.     }
  95.     public function getBody(): ?string
  96.     {
  97.         return $this->body;
  98.     }
  99.     public function setBody(?string $body): static
  100.     {
  101.         $this->body $body;
  102.         return $this;
  103.     }
  104.     public function getType(): ?string
  105.     {
  106.         return $this->type;
  107.     }
  108.     public function setType(?string $type): static
  109.     {
  110.         $this->type $type;
  111.         return $this;
  112.     }
  113.     public function getImage(): ?MediaObject
  114.     {
  115.         return $this->image;
  116.     }
  117.     public function setImage(?MediaObject $image): static
  118.     {
  119.         $this->image $image;
  120.         return $this;
  121.     }
  122.     public function getDateEntered(): ?\DateTimeInterface
  123.     {
  124.         return $this->dateEntered;
  125.     }
  126.     public function setDateEntered(?\DateTimeInterface $dateEntered): static
  127.     {
  128.         $this->dateEntered $dateEntered;
  129.         return $this;
  130.     }
  131.     public function getStatus(): ?string
  132.     {
  133.         return $this->status;
  134.     }
  135.     public function setStatus(?string $status): static
  136.     {
  137.         $this->status $status;
  138.         return $this;
  139.     }
  140.     public function getError(): ?string
  141.     {
  142.         return $this->error;
  143.     }
  144.     public function setError(string $error): static
  145.     {
  146.         $this->error $error;
  147.         return $this;
  148.     }
  149.     public function getDateSend(): ?\DateTimeInterface
  150.     {
  151.         return $this->dateSend;
  152.     }
  153.     public function setDateSend(?\DateTimeInterface $dateSend): static
  154.     {
  155.         $this->dateSend $dateSend;
  156.         return $this;
  157.     }
  158.     public function getPriority(): ?int
  159.     {
  160.         return $this->priority;
  161.     }
  162.     public function setPriority(?int $priority): static
  163.     {
  164.         $this->priority $priority;
  165.         return $this;
  166.     }
  167.     public function getSender(): ?string
  168.     {
  169.         return $this->sender;
  170.     }
  171.     public function setSender(?string $sender): static
  172.     {
  173.         $this->sender $sender;
  174.         return $this;
  175.     }
  176.     public function getNsMsgId(): ?string
  177.     {
  178.         return $this->ns_msg_id;
  179.     }
  180.     public function setNsMsgId(?string $ns_msg_id): static
  181.     {
  182.         $this->ns_msg_id $ns_msg_id;
  183.         return $this;
  184.     }
  185.     public function isAllUsers(): ?bool
  186.     {
  187.         return $this->allUsers;
  188.     }
  189.     public function setAllUsers(?bool $allUsers): static
  190.     {
  191.         $this->allUsers $allUsers;
  192.         return $this;
  193.     }
  194.     public function getNumberAccount(): ?string
  195.     {
  196.         return $this->numberAccount;
  197.     }
  198.     public function setNumberAccount(?string $numberAccount): static
  199.     {
  200.         $this->numberAccount $numberAccount;
  201.         return $this;
  202.     }
  203.     public function getMassiveNotification(): ?MassiveNotification
  204.     {
  205.         return $this->massiveNotification;
  206.     }
  207.     public function setMassiveNotification(?MassiveNotification $massiveNotification): static
  208.     {
  209.         $this->massiveNotification $massiveNotification;
  210.         return $this;
  211.     }
  212. }