Skip to content

Commit 0f0a5c0

Browse files
committed
config models
1 parent 761056e commit 0f0a5c0

File tree

6 files changed

+232
-0
lines changed

6 files changed

+232
-0
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Configuration;
6+
7+
use Doctrine\ORM\Mapping as ORM;
8+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
9+
use PhpList\Core\Domain\Repository\Configuration\ConfigRepository;
10+
11+
#[ORM\Entity(repositoryClass: ConfigRepository::class)]
12+
#[ORM\Table(name: "phplist_config")]
13+
class Config implements DomainModel
14+
{
15+
#[ORM\Id]
16+
#[ORM\Column(type: "string", length: 35)]
17+
private string $item;
18+
19+
#[ORM\Column(type: "text", nullable: true)]
20+
private ?string $value = null;
21+
22+
#[ORM\Column(type: "boolean", options: ["default" => 1])]
23+
private bool $editable = true;
24+
25+
#[ORM\Column(type: "string", length: 25, nullable: true)]
26+
private ?string $type = null;
27+
28+
public function getItem(): string
29+
{
30+
return $this->item;
31+
}
32+
33+
public function setItem(string $item): self
34+
{
35+
$this->item = $item;
36+
return $this;
37+
}
38+
39+
public function getValue(): ?string
40+
{
41+
return $this->value;
42+
}
43+
44+
public function setValue(?string $value): self
45+
{
46+
$this->value = $value;
47+
return $this;
48+
}
49+
50+
public function isEditable(): bool
51+
{
52+
return $this->editable;
53+
}
54+
55+
public function setEditable(bool $editable): self
56+
{
57+
$this->editable = $editable;
58+
return $this;
59+
}
60+
61+
public function getType(): ?string
62+
{
63+
return $this->type;
64+
}
65+
66+
public function setType(?string $type): self
67+
{
68+
$this->type = $type;
69+
return $this;
70+
}
71+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Configuration;
6+
7+
use DateTimeInterface;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
10+
use PhpList\Core\Domain\Model\Interfaces\Identity;
11+
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
12+
use PhpList\Core\Domain\Repository\Configuration\EventLogRepository;
13+
14+
#[ORM\Entity(repositoryClass: EventLogRepository::class)]
15+
#[ORM\Table(name: "phplist_eventlog")]
16+
#[ORM\Index(name: "enteredidx", columns: ["entered"])]
17+
#[ORM\Index(name: "pageidx", columns: ["page"])]
18+
class EventLog implements DomainModel, Identity
19+
{
20+
use IdentityTrait;
21+
22+
#[ORM\Column(type: "datetime", nullable: true)]
23+
private ?DateTimeInterface $entered = null;
24+
25+
#[ORM\Column(type: "string", length: 100, nullable: true)]
26+
private ?string $page = null;
27+
28+
#[ORM\Column(type: "text", nullable: true)]
29+
private ?string $entry = null;
30+
31+
public function getId(): int
32+
{
33+
return $this->id;
34+
}
35+
36+
public function getEntered(): ?DateTimeInterface
37+
{
38+
return $this->entered;
39+
}
40+
41+
public function setEntered(?DateTimeInterface $entered): self
42+
{
43+
$this->entered = $entered;
44+
return $this;
45+
}
46+
47+
public function getPage(): ?string
48+
{
49+
return $this->page;
50+
}
51+
52+
public function setPage(?string $page): self
53+
{
54+
$this->page = $page;
55+
return $this;
56+
}
57+
58+
public function getEntry(): ?string
59+
{
60+
return $this->entry;
61+
}
62+
63+
public function setEntry(?string $entry): self
64+
{
65+
$this->entry = $entry;
66+
return $this;
67+
}
68+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Configuration;
6+
7+
use Doctrine\ORM\Mapping as ORM;
8+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
9+
use PhpList\Core\Domain\Repository\Configuration\I18nRepository;
10+
11+
#[ORM\Entity(repositoryClass: I18nRepository::class)]
12+
#[ORM\Table(name: "phplist_i18n")]
13+
#[ORM\UniqueConstraint(name: "lanorigunq", columns: ["lan", "original"])]
14+
#[ORM\Index(name: "lanorigidx", columns: ["lan", "original"])]
15+
class I18n implements DomainModel
16+
{
17+
#[ORM\Id]
18+
#[ORM\Column(type: "string", length: 10)]
19+
private string $lan;
20+
21+
#[ORM\Id]
22+
#[ORM\Column(type: "text")]
23+
private string $original;
24+
25+
#[ORM\Column(type: "text")]
26+
private string $translation;
27+
28+
public function getLan(): string
29+
{
30+
return $this->lan;
31+
}
32+
33+
public function setLan(string $lan): self
34+
{
35+
$this->lan = $lan;
36+
return $this;
37+
}
38+
39+
public function getOriginal(): string
40+
{
41+
return $this->original;
42+
}
43+
44+
public function setOriginal(string $original): self
45+
{
46+
$this->original = $original;
47+
return $this;
48+
}
49+
50+
public function getTranslation(): string
51+
{
52+
return $this->translation;
53+
}
54+
55+
public function setTranslation(string $translation): self
56+
{
57+
$this->translation = $translation;
58+
return $this;
59+
}
60+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Repository\Configuration;
6+
7+
use PhpList\Core\Domain\Repository\AbstractRepository;
8+
9+
class ConfigRepository extends AbstractRepository
10+
{
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Repository\Configuration;
6+
7+
use PhpList\Core\Domain\Repository\AbstractRepository;
8+
9+
class EventLogRepository extends AbstractRepository
10+
{
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Repository\Configuration;
6+
7+
use PhpList\Core\Domain\Repository\AbstractRepository;
8+
9+
class I18nRepository extends AbstractRepository
10+
{
11+
}

0 commit comments

Comments
 (0)