<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @UniqueEntity(fields={"email", "locale"})
* @ORM\Table(
* uniqueConstraints={
* @ORM\UniqueConstraint(name="email_locale", columns={"email", "locale","source"})
* }
* )
* @ORM\Entity(repositoryClass="App\Repository\NewsletterRepository")
*/
class Newsletter
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=180)
*/
private $email;
/**
* @ORM\Column(type="string", length=4)
*/
private $locale;
/**
* @ORM\Column(type="datetime")
*/
private $createts;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $ip;
/**
* @ORM\Column(type="string", length=20, nullable=true)
*/
private $source = 'eshop';
/**
* @ORM\Column(type="boolean")
*/
private $isActive = true;
public function getId(): ?int
{
return $this->id;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getCreatets(): ?\DateTimeInterface
{
return $this->createts;
}
public function setCreatets(\DateTimeInterface $createts): self
{
$this->createts = $createts;
return $this;
}
public function getIp(): ?string
{
return $this->ip;
}
public function setIp(?string $ip): self
{
$this->ip = $ip;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
/**
* Get Locale
*
* @return mixed
*/
public function getLocale()
{
return $this->locale;
}
/**
* Set Locale
*
* @param mixed $locale
*/
public function setLocale( $locale )
{
$this->locale = $locale;
}
/**
* @return mixed
*/
public function getSource()
{
return $this->source;
}
/**
* @param mixed $source
*/
public function setSource($source): void
{
$this->source = $source;
}
}