<?php
namespace App\Entity;
use App\Repository\FrequentlyUsedAccountRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FrequentlyUsedAccountRepository::class)]
#[ORM\Table(name: 'tb_frequently_used_accounts')]
#[ORM\HasLifecycleCallbacks]
class FrequentlyUsedAccount
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer", unique: true)]
private ?int $id;
#[ORM\Column(type: 'string', length: 50, nullable: false)]
private ?string $code;
#[ORM\Column(type: 'string', length: 50, nullable: false)]
private ?string $compte;
#[ORM\Column(type: 'integer', nullable: false)]
private ?int $type;
#[ORM\ManyToOne(targetEntity: AppAccount::class, inversedBy: 'frequentlyUsedAccounts')]
#[ORM\JoinColumn(nullable: false)]
private ?AppAccount $account;
#[ORM\Column(type: 'datetime', nullable: true)]
private \DateTimeInterface $createdAt;
#[ORM\Column(type: 'boolean', nullable: true)]
private bool $activated;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->activated = true;
}
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getCompte(): ?string
{
return $this->compte;
}
public function setCompte(string $compte): self
{
$this->compte = $compte;
return $this;
}
public function getType(): ?int
{
return $this->type;
}
public function setType(int $type): self
{
$this->type = $type;
return $this;
}
public function getAccount(): ?AppAccount
{
return $this->account;
}
public function setAccount(?AppAccount $account): self
{
$this->account = $account;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getActivated(): ?bool
{
return $this->activated;
}
public function setActivated(?bool $activated): self
{
$this->activated = $activated;
return $this;
}
}