<?php
namespace App\Entity;
use App\Repository\NewsletterRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NewsletterRepository::class)
*/
class Newsletter
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $subject;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $body;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\ManyToOne(targetEntity=SubscriberGroup::class)
* @ORM\JoinColumn(nullable=true)
*/
private $subscriberGroup;
public function __construct()
{
$this->createdAt = new \DateTime('now', new \DateTimeZone('Europe/Paris'));
}
public function getId(): ?int
{
return $this->id;
}
public function getSubject(): ?string
{
return $this->subject;
}
public function setSubject(string $subject): self
{
$this->subject = $subject;
return $this;
}
public function getBody(): ?string
{
return $this->body;
}
public function setBody(?string $body): self
{
$this->body = $body;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getSubscriberGroup(): ?SubscriberGroup
{
return $this->subscriberGroup;
}
public function setSubscriberGroup(?SubscriberGroup $subscriberGroup): self
{
$this->subscriberGroup = $subscriberGroup;
return $this;
}
}