<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table("Admin")
*
* @ORM\HasLifecycleCallbacks()
*
* @ORM\Entity(repositoryClass="App\Repository\AdminRepository")
*/
class Admin
{
/**
* @ORM\Id()
*
* @ORM\GeneratedValue()
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Account", inversedBy="admin", cascade={"persist", "remove"})
*/
private $account;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\PrePersist()
*/
public function prePersist()
{
$this->setCreatedAt(new \DateTime());
}
public function getId(): ?int
{
return $this->id;
}
public function getAccount(): ?Account
{
return $this->account;
}
public function setAccount(Account $account): self
{
$this->account = $account;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
}