src/Entity/AgencyAccount.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AgencyAccountRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAgencyAccountRepository::class)]
  6. #[ORM\Table(name'tb_agencies_accounts')]
  7. #[ORM\HasLifecycleCallbacks]
  8. class AgencyAccount
  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'string'length50nullablefalse)]
  16.     private ?string $accountNumber;
  17.     #[ORM\Column(type'boolean'nullablefalse)]
  18.     private bool $headOffice;
  19.     #[ORM\Column(type'datetime'nullablefalse)]
  20.     private \DateTimeInterface $createdAt;
  21.     #[ORM\Column(type'datetime'nullabletrue)]
  22.     private ?\DateTimeInterface $modifiedAt;
  23.     #[ORM\Column(type'boolean'nullabletrue)]
  24.     private bool $activated;
  25.     #[ORM\ManyToOne(targetEntityProvider::class)]
  26.     private ?Provider $provider;
  27.     #[ORM\ManyToOne(targetEntityCurrency::class)]
  28.     private ?Currency $currency;
  29.     #[ORM\ManyToOne(targetEntityAgency::class, inversedBy'agencyAccounts')]
  30.     private ?Agency $agency;
  31.     #[ORM\ManyToOne(targetEntityAgency::class)]
  32.     private ?Agency $linkAgency;
  33.     #[ORM\ManyToOne(targetEntityAgencyAccountType::class)]
  34.     private ?AgencyAccountType $agencyAccountType;
  35.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'agencyAccounts')]
  36.     private ?User $createdBy;
  37.     public function __construct()
  38.     {
  39.         $this->createdAt = new \DateTime();
  40.         $this->activated false;
  41.         $this->headOffice false;
  42.     }
  43.     public function getId(): ?string
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function setId(string $id): self
  48.     {
  49.         $this->id $id;
  50.         return $this;
  51.     }
  52.     public function getName(): ?string
  53.     {
  54.         return $this->name;
  55.     }
  56.     public function setName(string $name): self
  57.     {
  58.         $this->name $name;
  59.         return $this;
  60.     }
  61.     public function getAccountNumber(): ?string
  62.     {
  63.         return $this->accountNumber;
  64.     }
  65.     public function setAccountNumber(string $accountNumber): self
  66.     {
  67.         $this->accountNumber $accountNumber;
  68.         return $this;
  69.     }
  70.     public function getHeadOffice(): ?bool
  71.     {
  72.         return $this->headOffice;
  73.     }
  74.     public function setHeadOffice(?bool $headOffice): self
  75.     {
  76.         $this->headOffice $headOffice;
  77.         return $this;
  78.     }
  79.     public function getCreatedAt(): ?\DateTimeInterface
  80.     {
  81.         return $this->createdAt;
  82.     }
  83.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  84.     {
  85.         $this->createdAt $createdAt;
  86.         return $this;
  87.     }
  88.     public function getModifiedAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->modifiedAt;
  91.     }
  92.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  93.     {
  94.         $this->modifiedAt $modifiedAt;
  95.         return $this;
  96.     }
  97.     public function getActivated(): ?bool
  98.     {
  99.         return $this->activated;
  100.     }
  101.     public function setActivated(?bool $activated): self
  102.     {
  103.         $this->activated $activated;
  104.         return $this;
  105.     }
  106.     public function getProvider(): ?Provider
  107.     {
  108.         return $this->provider;
  109.     }
  110.     public function setProvider(?Provider $provider): self
  111.     {
  112.         $this->provider $provider;
  113.         return $this;
  114.     }
  115.     public function getCurrency(): ?Currency
  116.     {
  117.         return $this->currency;
  118.     }
  119.     public function setCurrency(?Currency $currency): self
  120.     {
  121.         $this->currency $currency;
  122.         return $this;
  123.     }
  124.     public function getAgency(): ?Agency
  125.     {
  126.         return $this->agency;
  127.     }
  128.     public function setAgency(?Agency $agency): self
  129.     {
  130.         $this->agency $agency;
  131.         return $this;
  132.     }
  133.     public function getLinkAgency(): ?Agency
  134.     {
  135.         return $this->linkAgency;
  136.     }
  137.     public function setLinkAgency(?Agency $linkAgency): self
  138.     {
  139.         $this->linkAgency $linkAgency;
  140.         return $this;
  141.     }
  142.     public function getAgencyAccountType(): ?AgencyAccountType
  143.     {
  144.         return $this->agencyAccountType;
  145.     }
  146.     public function setAgencyAccountType(?AgencyAccountType $agencyAccountType): self
  147.     {
  148.         $this->agencyAccountType $agencyAccountType;
  149.         return $this;
  150.     }
  151.     public function getCreatedBy(): ?User
  152.     {
  153.         return $this->createdBy;
  154.     }
  155.     public function setCreatedBy(?User $createdBy): self
  156.     {
  157.         $this->createdBy $createdBy;
  158.         return $this;
  159.     }
  160.     /**
  161.      * @ORM\PreUpdate
  162.      */
  163.     public function onUpdate() {
  164.         $this->modifiedAt = new \DateTime();
  165.     }
  166. }