<?php
namespace App\Entity;
use App\Repository\AgencyAccountRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AgencyAccountRepository::class)]
#[ORM\Table(name: 'tb_agencies_accounts')]
#[ORM\HasLifecycleCallbacks]
class AgencyAccount
{
#[ORM\Id]
#[ORM\Column(type: "string", unique: true)]
private ?string $id;
#[ORM\Column(type: 'string', length: 50, nullable: false)]
private ?string $name;
#[ORM\Column(type: 'string', length: 50, nullable: false)]
private ?string $accountNumber;
#[ORM\Column(type: 'boolean', nullable: false)]
private bool $headOffice;
#[ORM\Column(type: 'datetime', nullable: false)]
private \DateTimeInterface $createdAt;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTimeInterface $modifiedAt;
#[ORM\Column(type: 'boolean', nullable: true)]
private bool $activated;
#[ORM\ManyToOne(targetEntity: Provider::class)]
private ?Provider $provider;
#[ORM\ManyToOne(targetEntity: Currency::class)]
private ?Currency $currency;
#[ORM\ManyToOne(targetEntity: Agency::class, inversedBy: 'agencyAccounts')]
private ?Agency $agency;
#[ORM\ManyToOne(targetEntity: Agency::class)]
private ?Agency $linkAgency;
#[ORM\ManyToOne(targetEntity: AgencyAccountType::class)]
private ?AgencyAccountType $agencyAccountType;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'agencyAccounts')]
private ?User $createdBy;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->activated = false;
$this->headOffice = false;
}
public function getId(): ?string
{
return $this->id;
}
public function setId(string $id): self
{
$this->id = $id;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getAccountNumber(): ?string
{
return $this->accountNumber;
}
public function setAccountNumber(string $accountNumber): self
{
$this->accountNumber = $accountNumber;
return $this;
}
public function getHeadOffice(): ?bool
{
return $this->headOffice;
}
public function setHeadOffice(?bool $headOffice): self
{
$this->headOffice = $headOffice;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getModifiedAt(): ?\DateTimeInterface
{
return $this->modifiedAt;
}
public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
{
$this->modifiedAt = $modifiedAt;
return $this;
}
public function getActivated(): ?bool
{
return $this->activated;
}
public function setActivated(?bool $activated): self
{
$this->activated = $activated;
return $this;
}
public function getProvider(): ?Provider
{
return $this->provider;
}
public function setProvider(?Provider $provider): self
{
$this->provider = $provider;
return $this;
}
public function getCurrency(): ?Currency
{
return $this->currency;
}
public function setCurrency(?Currency $currency): self
{
$this->currency = $currency;
return $this;
}
public function getAgency(): ?Agency
{
return $this->agency;
}
public function setAgency(?Agency $agency): self
{
$this->agency = $agency;
return $this;
}
public function getLinkAgency(): ?Agency
{
return $this->linkAgency;
}
public function setLinkAgency(?Agency $linkAgency): self
{
$this->linkAgency = $linkAgency;
return $this;
}
public function getAgencyAccountType(): ?AgencyAccountType
{
return $this->agencyAccountType;
}
public function setAgencyAccountType(?AgencyAccountType $agencyAccountType): self
{
$this->agencyAccountType = $agencyAccountType;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->createdBy;
}
public function setCreatedBy(?User $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
/**
* @ORM\PreUpdate
*/
public function onUpdate() {
$this->modifiedAt = new \DateTime();
}
}