src/Entity/Core/Notifications.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core;
  3. use App\Entity\Core\Agencies;
  4. use App\Entity\Shop\Shop;
  5. use Doctrine\DBAL\Types\Types;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10.  * Notifications
  11.  *
  12.  * @ORM\Table("core_notifications")
  13.  * @ORM\Entity(repositoryClass="App\Repository\Core\NotificationsRepository")
  14.  * @ORM\HasLifecycleCallbacks()
  15.  */
  16. class Notifications
  17. {
  18.     /**
  19.      * @var integer
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     protected $id;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  30.      */
  31.     private $createdAt;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  36.      */
  37.     private $updatedAt;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="title", type="text", nullable=true)
  42.      */
  43.     private $title;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="description", type="text", nullable=true)
  48.      */
  49.     private $description;
  50.     /**
  51.      * @var string
  52.      *
  53.      * @ORM\Column(name="type", type="text", nullable=true)
  54.      */
  55.     private $type;
  56.     /**
  57.      * @var string
  58.      *
  59.      * @ORM\Column(name="only_admin", type="boolean", nullable=true)
  60.      */
  61.     private $onlyAdmin;
  62.     /**
  63.      * @var \Users
  64.      *
  65.      * @ORM\ManyToOne(targetEntity="App\Entity\Core\Users")
  66.      * @ORM\JoinColumns({
  67.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
  68.      * })
  69.      */
  70.     protected $user;
  71.     /**
  72.      * @var string
  73.      *
  74.      * @ORM\Column(name="viewed", type="boolean", nullable=true)
  75.      */
  76.     private $viewed;
  77.     /**
  78.      * @ORM\PrePersist
  79.      */
  80.     public function setCreatedAtValue(): void {
  81.         $this->setCreatedAt(new \DateTime("now"));
  82.         $this->setUpdatedAt(new \DateTime("now"));
  83.     }
  84.     /**
  85.      * @ORM\PreUpdate
  86.      */
  87.     public function setUpdatedAtValue(): void {
  88.         $this->setUpdatedAt(new \DateTime("now"));
  89.     }
  90.     public function __toString() {
  91.         return $this->title;
  92.     }
  93.     public function getId(): ?int
  94.     {
  95.         return $this->id;
  96.     }
  97.     public function getCreatedAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->createdAt;
  100.     }
  101.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  102.     {
  103.         $this->createdAt $createdAt;
  104.         return $this;
  105.     }
  106.     public function getUpdatedAt(): ?\DateTimeInterface
  107.     {
  108.         return $this->updatedAt;
  109.     }
  110.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  111.     {
  112.         $this->updatedAt $updatedAt;
  113.         return $this;
  114.     }
  115.     public function getTitle(): ?string
  116.     {
  117.         return $this->title;
  118.     }
  119.     public function setTitle(?string $title): static
  120.     {
  121.         $this->title $title;
  122.         return $this;
  123.     }
  124.     public function getDescription(): ?string
  125.     {
  126.         return $this->description;
  127.     }
  128.     public function setDescription(?string $description): static
  129.     {
  130.         $this->description $description;
  131.         return $this;
  132.     }
  133.     public function getType(): ?string
  134.     {
  135.         return $this->type;
  136.     }
  137.     public function setType(?string $type): static
  138.     {
  139.         $this->type $type;
  140.         return $this;
  141.     }
  142.     public function isOnlyAdmin(): ?bool
  143.     {
  144.         return $this->onlyAdmin;
  145.     }
  146.     public function setOnlyAdmin(?bool $onlyAdmin): static
  147.     {
  148.         $this->onlyAdmin $onlyAdmin;
  149.         return $this;
  150.     }
  151.     public function getUser(): ?Users
  152.     {
  153.         return $this->user;
  154.     }
  155.     public function setUser(?Users $user): static
  156.     {
  157.         $this->user $user;
  158.         return $this;
  159.     }
  160.     public function isViewed(): ?bool
  161.     {
  162.         return $this->viewed;
  163.     }
  164.     public function setViewed(?bool $viewed): static
  165.     {
  166.         $this->viewed $viewed;
  167.         return $this;
  168.     }
  169. }