src/Entity/CRM/EntityChangeLog.php line 14

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\EntityChangeLogRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassEntityChangeLogRepository::class)]
  7. #[ORM\Table(indexes: [
  8.     new ORM\Index(columns: ['entity_class''entity_id''created_at'], name'IDX_ECL_CLASS_ENTITY_CREATED'),
  9. ])]
  10. #[ORM\HasLifecycleCallbacks]
  11. class EntityChangeLog
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $entityClass null;
  19.     #[ORM\Column]
  20.     private ?int $entityId null;
  21.     #[ORM\Column(length50)]
  22.     private ?string $action null;
  23.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  24.     private ?string $oldValues null;
  25.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  26.     private ?string $newValues null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  28.     private ?\DateTimeInterface $createdAt null;
  29.     #[ORM\ManyToOne(targetEntityAdmin::class)]
  30.     #[ORM\JoinColumn(nullabletrue)]
  31.     private ?Admin $changedBy null;
  32.     #[ORM\Column(length45nullabletrue)]
  33.     private ?string $ipAddress null;
  34.     #[ORM\ManyToOne(inversedBy'entityChangeLogs')]
  35.     private ?Consultant $changedByConsultant null;
  36.     public function __construct()
  37.     {
  38.         $this->changedBy null;
  39.         $this->changedByConsultant null;
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getEntityClass(): ?string
  46.     {
  47.         return $this->entityClass;
  48.     }
  49.     public function setEntityClass(string $entityClass): self
  50.     {
  51.         $this->entityClass $entityClass;
  52.         return $this;
  53.     }
  54.     public function getEntityId(): ?int
  55.     {
  56.         return $this->entityId;
  57.     }
  58.     public function setEntityId(int $entityId): self
  59.     {
  60.         $this->entityId $entityId;
  61.         return $this;
  62.     }
  63.     public function getAction(): ?string
  64.     {
  65.         return $this->action;
  66.     }
  67.     public function setAction(string $action): self
  68.     {
  69.         $this->action $action;
  70.         return $this;
  71.     }
  72.     public function getOldValues(): ?string
  73.     {
  74.         return $this->oldValues;
  75.     }
  76.     public function setOldValues(?string $oldValues): self
  77.     {
  78.         $this->oldValues $oldValues;
  79.         return $this;
  80.     }
  81.     public function getNewValues(): ?string
  82.     {
  83.         return $this->newValues;
  84.     }
  85.     public function setNewValues(?string $newValues): self
  86.     {
  87.         $this->newValues $newValues;
  88.         return $this;
  89.     }
  90.     public function getCreatedAt(): ?\DateTimeInterface
  91.     {
  92.         return $this->createdAt;
  93.     }
  94.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  95.     {
  96.         $this->createdAt $createdAt;
  97.         return $this;
  98.     }
  99.     #[ORM\PrePersist]
  100.     public function setCreatedAtValue(): void
  101.     {
  102.         $this->createdAt = new \DateTime();
  103.     }
  104.     public function getChangedBy(): ?Admin
  105.     {
  106.         return $this->changedBy;
  107.     }
  108.     public function setChangedBy(?Admin $changedBy): self
  109.     {
  110.         $this->changedBy $changedBy;
  111.         return $this;
  112.     }
  113.     public function getIpAddress(): ?string
  114.     {
  115.         return $this->ipAddress;
  116.     }
  117.     public function setIpAddress(?string $ipAddress): void
  118.     {
  119.         $this->ipAddress $ipAddress;
  120.     }
  121.     public function getChangedByConsultant(): ?Consultant
  122.     {
  123.         return $this->changedByConsultant;
  124.     }
  125.     public function setChangedByConsultant(?Consultant $changedByConsultant): static
  126.     {
  127.         $this->changedByConsultant $changedByConsultant;
  128.         return $this;
  129.     }
  130. }