src/Entity/NotificationSearch.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationSearchRepository;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=NotificationSearchRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class NotificationSearch
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\ManyToOne(targetEntity=Customer::class, inversedBy="notificationSearches")
  20.      * @ORM\JoinColumn(nullable=false)
  21.      */
  22.     private $customer;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $search;
  27.     /**
  28.      * @ORM\Column(type="datetime")
  29.      */
  30.     private $created_at;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $updated_at;
  35.     /**
  36.      * @ORM\Column(type="datetime")
  37.      */
  38.     private $last_send_date;
  39.     private $searchText;
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCustomer(): ?Customer
  45.     {
  46.         return $this->customer;
  47.     }
  48.     public function setCustomer(?Customer $customer): self
  49.     {
  50.         $this->customer $customer;
  51.         return $this;
  52.     }
  53.     public function getSearch(): ?string
  54.     {
  55.         return $this->search;
  56.     }
  57.     public function setSearch(string $search): self
  58.     {
  59.         $this->search $search;
  60.         return $this;
  61.     }
  62.     public function getCreatedAt(): ?\DateTimeInterface
  63.     {
  64.         return $this->created_at;
  65.     }
  66.     public function setCreatedAt(\DateTimeInterface $created_at): self
  67.     {
  68.         $this->created_at $created_at;
  69.         return $this;
  70.     }
  71.     public function getUpdatedAt(): ?\DateTimeInterface
  72.     {
  73.         return $this->updated_at;
  74.     }
  75.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  76.     {
  77.         $this->updated_at $updated_at;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @ORM\PrePersist
  82.      * @ORM\PreUpdate
  83.      */
  84.     public function updatedTimestamps(): void
  85.     {
  86.         $now = new \DateTime('now');
  87.         $this->setUpdatedAt($now);
  88.         if (null === $this->getCreatedAt()) {
  89.             $this->setCreatedAt($now);
  90.         }
  91.     }
  92.     public function getSearchText(): ?string
  93.     {
  94.         return $this->searchText;
  95.     }
  96.     public function setSearchText(string $searchText): self
  97.     {
  98.         $this->searchText $searchText;
  99.         return $this;
  100.     }
  101.     public function getLastSendDate(): ?DateTime
  102.     {
  103.         return $this->last_send_date;
  104.     }
  105.     public function setLastSendDate(DateTime $last_send_date): self
  106.     {
  107.         $this->last_send_date $last_send_date;
  108.         return $this;
  109.     }
  110. }