src/Entity/AgencyAccountType.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AgencyAccountTypeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAgencyAccountTypeRepository::class)]
  6. #[ORM\Table(name'tb_agencies_accounts_types')]
  7. #[ORM\HasLifecycleCallbacks]
  8. class AgencyAccountType
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\Column(type"string"uniquetrue)]
  12.     private ?string $id;
  13.     #[ORM\Column(type'string'length50nullablefalse)]
  14.     private ?string $name;
  15.     #[ORM\Column(type'integer'nullablefalse)]
  16.     private ?int $type;
  17.     #[ORM\Column(type'datetime'nullablefalse)]
  18.     private \DateTimeInterface $createdAt;
  19.     #[ORM\Column(type'datetime'nullablefalse)]
  20.     private ?\DateTimeInterface $modifiedAt;
  21.     #[ORM\Column(type'boolean'nullablefalse)]
  22.     private bool $activated;
  23.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'agencyAccountTypes')]
  24.     private ?User $createdBy;
  25.     public function __construct()
  26.     {
  27.         $this->createdAt = new \DateTime();
  28.         $this->activated true;
  29.     }
  30.     public function getId(): ?string
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function setId(string $id): self
  35.     {
  36.         $this->id $id;
  37.         return $this;
  38.     }
  39.     public function getName(): ?string
  40.     {
  41.         return $this->name;
  42.     }
  43.     public function setName(string $name): self
  44.     {
  45.         $this->name $name;
  46.         return $this;
  47.     }
  48.     public function getType(): ?int
  49.     {
  50.         return $this->type;
  51.     }
  52.     public function setType(int $type): self
  53.     {
  54.         $this->type $type;
  55.         return $this;
  56.     }
  57.     public function getCreatedAt(): ?\DateTimeInterface
  58.     {
  59.         return $this->createdAt;
  60.     }
  61.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  62.     {
  63.         $this->createdAt $createdAt;
  64.         return $this;
  65.     }
  66.     public function getModifiedAt(): ?\DateTimeInterface
  67.     {
  68.         return $this->modifiedAt;
  69.     }
  70.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  71.     {
  72.         $this->modifiedAt $modifiedAt;
  73.         return $this;
  74.     }
  75.     public function getActivated(): ?bool
  76.     {
  77.         return $this->activated;
  78.     }
  79.     public function setActivated(?bool $activated): self
  80.     {
  81.         $this->activated $activated;
  82.         return $this;
  83.     }
  84.     public function getCreatedBy(): ?User
  85.     {
  86.         return $this->createdBy;
  87.     }
  88.     public function setCreatedBy(?User $createdBy): self
  89.     {
  90.         $this->createdBy $createdBy;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @ORM\PreUpdate
  95.      */
  96.     public function onUpdate() {
  97.         $this->modifiedAt = new \DateTime();
  98.     }
  99. }