src/Entity/Admin.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Table("Admin")
  6.  *
  7.  * @ORM\HasLifecycleCallbacks()
  8.  *
  9.  * @ORM\Entity(repositoryClass="App\Repository\AdminRepository")
  10.  */
  11. class Admin
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      *
  16.      * @ORM\GeneratedValue()
  17.      *
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\OneToOne(targetEntity="App\Entity\Account", inversedBy="admin", cascade={"persist", "remove"})
  23.      */
  24.     private $account;
  25.     /**
  26.      * @ORM\Column(type="datetime")
  27.      */
  28.     private $created_at;
  29.     /**
  30.      * @ORM\PrePersist()
  31.      */
  32.     public function prePersist()
  33.     {
  34.         $this->setCreatedAt(new \DateTime());
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getAccount(): ?Account
  41.     {
  42.         return $this->account;
  43.     }
  44.     public function setAccount(Account $account): self
  45.     {
  46.         $this->account $account;
  47.         return $this;
  48.     }
  49.     public function getCreatedAt(): ?\DateTimeInterface
  50.     {
  51.         return $this->created_at;
  52.     }
  53.     public function setCreatedAt(\DateTimeInterface $created_at): self
  54.     {
  55.         $this->created_at $created_at;
  56.         return $this;
  57.     }
  58. }