src/Entity/Compte.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CompteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassCompteRepository::class)]
  8. #[ORM\Table(name'tb_comptes')]
  9. #[ORM\HasLifecycleCallbacks]
  10. class Compte
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column(type"integer"uniquetrue)]
  15.     private ?int $id;
  16.     #[ORM\Column(type'string'length50nullablefalse)]
  17.     private ?string $code;
  18.     #[ORM\Column(type'string'length50nullabletrue)]
  19.     private ?string $clientCode;
  20.     #[ORM\Column(type'boolean'nullabletrue)]
  21.     private bool $activated;
  22.     #[ORM\Column(type'boolean'nullabletrue)]
  23.     private bool $deleted;
  24.     #[ORM\Column(type'datetime'nullabletrue)]
  25.     private \DateTimeInterface $createdAt;
  26.     #[ORM\Column(type'datetime'nullabletrue)]
  27.     private ?\DateTimeInterface $modifiedAt;
  28.     #[ORM\ManyToOne(targetEntityAppAccount::class, inversedBy'comptes')]
  29.     private ?AppAccount $appAccount;
  30.     #[ORM\ManyToOne(targetEntityUser::class)]
  31.     private ?User $createdBy;
  32.     #[ORM\Column(type'string'length100nullabletrue)]
  33.     private ?string $name;
  34.     public function __construct()
  35.     {
  36.         $this->createdAt = new \DateTime();
  37.         $this->deleted false;
  38.         $this->activated true;
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCode(): ?string
  45.     {
  46.         return $this->code;
  47.     }
  48.     public function setCode(string $code): self
  49.     {
  50.         $this->code $code;
  51.         return $this;
  52.     }
  53.     public function getClientCode(): ?string
  54.     {
  55.         return $this->clientCode;
  56.     }
  57.     public function setClientCode(string $clientCode): self
  58.     {
  59.         $this->clientCode $clientCode;
  60.         return $this;
  61.     }
  62.     public function getActivated(): ?bool
  63.     {
  64.         return $this->activated;
  65.     }
  66.     public function setActivated(?bool $activated): self
  67.     {
  68.         $this->activated $activated;
  69.         return $this;
  70.     }
  71.     public function getDeleted(): ?bool
  72.     {
  73.         return $this->deleted;
  74.     }
  75.     public function setDeleted(?bool $deleted): self
  76.     {
  77.         $this->deleted $deleted;
  78.         return $this;
  79.     }
  80.     public function getCreatedAt(): ?\DateTimeInterface
  81.     {
  82.         return $this->createdAt;
  83.     }
  84.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  85.     {
  86.         $this->createdAt $createdAt;
  87.         return $this;
  88.     }
  89.     public function getModifiedAt(): ?\DateTimeInterface
  90.     {
  91.         return $this->modifiedAt;
  92.     }
  93.     public function setModifiedAt(?\DateTimeInterface $modifiedAt): self
  94.     {
  95.         $this->modifiedAt $modifiedAt;
  96.         return $this;
  97.     }
  98.     public function getAppAccount(): ?AppAccount
  99.     {
  100.         return $this->appAccount;
  101.     }
  102.     public function setAppAccount(?AppAccount $appAccount): self
  103.     {
  104.         $this->appAccount $appAccount;
  105.         return $this;
  106.     }
  107.     public function getCreatedBy(): ?User
  108.     {
  109.         return $this->createdBy;
  110.     }
  111.     public function setCreatedBy(?User $createdBy): self
  112.     {
  113.         $this->createdBy $createdBy;
  114.         return $this;
  115.     }
  116.     /**
  117.      * @ORM\PreUpdate
  118.      */
  119.     public function onUpdate() {
  120.         $this->modifiedAt = new \DateTime();
  121.     }
  122.     public function getName(): ?string
  123.     {
  124.         return $this->name;
  125.     }
  126.     public function setName(?string $name): self
  127.     {
  128.         $this->name $name;
  129.         return $this;
  130.     }
  131. }