Skip to content

Commit b670d90

Browse files
fajinfoindjeto
authored andcommitted
Add constructor on entities
1 parent 68590f8 commit b670d90

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/Entity/Association.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ class Association
1616

1717
private string $class;
1818

19+
public function __construct(string $type, ?string $table, ?string $label, int $fk, string $class): void{
20+
$this->typ = $type;
21+
$this->tbl = $table;
22+
$this->label = $label;
23+
$this->fk = $fk;
24+
$this->class = $class;
25+
}
26+
1927
public function getId(): ?string
2028
{
2129
return $this->id;

src/Entity/AuditLog.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ class AuditLog
2020

2121
private \DateTimeInterface $loggedAt;
2222

23+
public function __construct(string $action, string $table, ?Association $source=null, ?Association $target=null, ?Association $blame=null, ?array $diff=[], ?\DateTimeInterface $date=null): void
24+
{
25+
$this->action = $action;
26+
$this->tbl = $table;
27+
$this->source = $source;
28+
$this->target = $target;
29+
$this->blame = $blame;
30+
$this->diff = $diff;
31+
$this->loggedAt = $date;
32+
}
33+
2334
public function getId(): ?string
2435
{
2536
return $this->id;

0 commit comments

Comments
 (0)