<?php
namespace App\Entity;
use App\Repository\NewsletterTypeUsersRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=NewsletterTypeUsersRepository::class)
*/
class NewsletterTypeUsers
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=user::class, inversedBy="newsletterTypeUsers")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=NewsletterType::class, inversedBy="newsletterTypeUsers")
* @ORM\JoinColumn(nullable=false)
*/
private $type;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updated_at;
public function __construct()
{
$this->created_at=new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?user
{
return $this->user;
}
public function setUser(?user $user): self
{
$this->user = $user;
return $this;
}
public function getType(): ?NewsletterType
{
return $this->type;
}
public function setType(?NewsletterType $type): self
{
$this->type = $type;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
}