Skip to content

ISSUE-345 #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e748570
ISSUE-345: add relation to subscriber attributes
tatevikg1 Apr 8, 2025
29657c9
ISSUE-345: return self after set
tatevikg1 Apr 9, 2025
b4d1e8a
ISSUE-345: fix traits
tatevikg1 Apr 9, 2025
58b548e
ISSUE-345: add method in SubscriptionRepository
tatevikg1 Apr 13, 2025
915df7e
ISSUE-345: message repository
tatevikg1 Apr 15, 2025
bbbfb09
ISSUE-345: message fixture
tatevikg1 Apr 16, 2025
8b81d3a
ISSUE-345: message fixture + test
tatevikg1 Apr 16, 2025
2047f77
ISSUE-345: column name fix
tatevikg1 Apr 16, 2025
c5d1429
ISSUE-345: remove prefix
tatevikg1 Apr 16, 2025
743fc18
ISSUE-345: make format props bool
tatevikg1 Apr 16, 2025
ef70b5f
ISSUE-345: relation to template in message
tatevikg1 Apr 17, 2025
89044e3
ISSUE-345: update runner
tatevikg1 Apr 17, 2025
eb6c91b
ISSUE-345: template repo
tatevikg1 Apr 19, 2025
5412507
ISSUE-345: move to dirs
tatevikg1 Apr 19, 2025
fba5aa9
ISSUE-345: add test + fix template
tatevikg1 Apr 19, 2025
be0c5d9
ISSUE-345: message setters
tatevikg1 Apr 19, 2025
6d68353
ISSUE-345: tests
tatevikg1 Apr 19, 2025
4476452
ISSUE-345: set message embedded elements
tatevikg1 Apr 21, 2025
b003df6
ISSUE-345: sendstart in metadata
tatevikg1 Apr 21, 2025
5ff1384
ISSUE-345: EmbeddableInterface interface
tatevikg1 Apr 21, 2025
7aa99b2
ISSUE-345: image data resource fix
tatevikg1 Apr 22, 2025
3882b9e
ISSUE-345: update template property names
tatevikg1 Apr 24, 2025
810f2da
ISSUE-345: TemplateImageRepository
tatevikg1 Apr 24, 2025
2f14372
ISSUE-345: update admin prop name (email)
tatevikg1 Apr 29, 2025
4538aa9
ISSUE-345: createdAt/updatedAt
tatevikg1 Apr 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
jobs:
main:
name: phpList on PHP ${{ matrix.php-versions }} [Build, Test]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
env:
DB_DATABASE: phplist
DB_USERNAME: root
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/core-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
jobs:
make-restapi-docs:
name: Checkout phpList core and generate docs using `phpDocumentor`
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
path: phpdocumentor.zip
deploy-docs:
name: Deploy Core Docs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: make-restapi-docs
steps:
- name: Checkout phplist/core-docs
Expand Down
19 changes: 17 additions & 2 deletions config/repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ services:
arguments:
- PhpList\Core\Domain\Model\Identity\AdministratorToken

PhpList\Core\Domain\Repository\Messaging\SubscriberListRepository:
PhpList\Core\Domain\Repository\Subscription\SubscriberListRepository:
parent: PhpList\Core\Domain\Repository
arguments:
- PhpList\Core\Domain\Model\Messaging\SubscriberList
- PhpList\Core\Domain\Model\Subscription\SubscriberList

PhpList\Core\Domain\Repository\Subscription\SubscriberRepository:
parent: PhpList\Core\Domain\Repository
Expand All @@ -25,3 +25,18 @@ services:
parent: PhpList\Core\Domain\Repository
arguments:
- PhpList\Core\Domain\Model\Subscription\Subscription

PhpList\Core\Domain\Repository\Messaging\MessageRepository:
parent: PhpList\Core\Domain\Repository
arguments:
- PhpList\Core\Domain\Model\Messaging\Message

PhpList\Core\Domain\Repository\Messaging\TemplateRepository:
parent: PhpList\Core\Domain\Repository
arguments:
- PhpList\Core\Domain\Model\Messaging\Template

PhpList\Core\Domain\Repository\Messaging\TemplateImageRepository:
parent: PhpList\Core\Domain\Repository
arguments:
- PhpList\Core\Domain\Model\Messaging\TemplateImage
13 changes: 11 additions & 2 deletions src/Domain/Model/Analytics/LinkTrackForward.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use PhpList\Core\Domain\Repository\Analytics\LinkTrackForwardRepository;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: LinkTrackForwardRepository::class)]
#[ORM\Table(name: 'phplist_linktrack_forward')]
Expand All @@ -17,7 +17,11 @@
#[ORM\Index(name: 'uuididx', columns: ['uuid'])]
class LinkTrackForward implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(type: 'string', length: 2083, nullable: true)]
private ?string $url = null;
Expand All @@ -31,6 +35,11 @@ class LinkTrackForward implements DomainModel, Identity
#[ORM\Column(type: 'boolean', nullable: true, options: ['default' => 0])]
private bool $personalise = false;

public function getId(): ?int
{
return $this->id;
}

public function getUrl(): ?string
{
return $this->url;
Expand Down
13 changes: 11 additions & 2 deletions src/Domain/Model/Analytics/LinkTrackUmlClick.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use PhpList\Core\Domain\Repository\Analytics\LinkTrackUmlClickRepository;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: LinkTrackUmlClickRepository::class)]
#[ORM\Table(name: 'phplist_linktrack_uml_click')]
Expand All @@ -19,7 +19,11 @@
#[ORM\Index(name: 'uidindex', columns: ['userid'])]
class LinkTrackUmlClick implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'messageid', type: 'integer')]
private int $messageId;
Expand All @@ -45,6 +49,11 @@ class LinkTrackUmlClick implements DomainModel, Identity
#[ORM\Column(name: 'textclicked', type: 'integer', nullable: true, options: ['default' => 0])]
private ?int $textClicked = 0;

public function getId(): ?int
{
return $this->id;
}

public function getMessageId(): int
{
return $this->messageId;
Expand Down
13 changes: 11 additions & 2 deletions src/Domain/Model/Analytics/UserMessageView.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity]
#[ORM\Table(name: 'phplist_user_message_view')]
Expand All @@ -17,7 +17,11 @@
#[ORM\Index(name: 'usermsgidx', columns: ['userid', 'messageid'])]
class UserMessageView implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'messageid', type: 'integer')]
private int $messageId;
Expand All @@ -34,6 +38,11 @@ class UserMessageView implements DomainModel, Identity
#[ORM\Column(name: 'data', type: 'text', nullable: true)]
private ?string $data = null;

public function getId(): ?int
{
return $this->id;
}

public function getMessageId(): int
{
return $this->messageId;
Expand Down
13 changes: 11 additions & 2 deletions src/Domain/Model/Analytics/UserStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity]
#[ORM\Table(name: 'phplist_userstats')]
Expand All @@ -18,7 +18,11 @@
#[ORM\Index(name: 'listindex', columns: ['listid'])]
class UserStats implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'unixdate', type: 'integer', nullable: true)]
private ?int $unixDate = null;
Expand All @@ -32,6 +36,11 @@ class UserStats implements DomainModel, Identity
#[ORM\Column(name: 'value', type: 'integer', options: ['default' => 0])]
private int $value = 0;

public function getId(): ?int
{
return $this->id;
}

public function getUnixDate(): ?int
{
return $this->unixDate;
Expand Down
10 changes: 7 additions & 3 deletions src/Domain/Model/Configuration/EventLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use PhpList\Core\Domain\Repository\Configuration\EventLogRepository;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: EventLogRepository::class)]
#[ORM\Table(name: 'phplist_eventlog')]
#[ORM\Index(name: 'enteredidx', columns: ['entered'])]
#[ORM\Index(name: 'pageidx', columns: ['page'])]
class EventLog implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(type: 'datetime', nullable: true)]
private ?DateTimeInterface $entered = null;
Expand All @@ -28,7 +32,7 @@ class EventLog implements DomainModel, Identity
#[ORM\Column(type: 'text', nullable: true)]
private ?string $entry = null;

public function getId(): int
public function getId(): ?int
{
return $this->id;
}
Expand Down
13 changes: 11 additions & 2 deletions src/Domain/Model/Configuration/UrlCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity]
#[ORM\Table(name: 'phplist_urlcache')]
#[ORM\Index(name: 'urlindex', columns: ['url'])]
class UrlCache implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'url', type: 'string', length: 2083)]
private string $url;
Expand All @@ -29,6 +33,11 @@ class UrlCache implements DomainModel, Identity
#[ORM\Column(name: 'content', type: 'blob', nullable: true)]
private ?string $content = null;

public function getId(): ?int
{
return $this->id;
}

public function getUrl(): string
{
return $this->url;
Expand Down
34 changes: 25 additions & 9 deletions src/Domain/Model/Identity/AdminAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use PhpList\Core\Domain\Repository\Identity\AdminAttributeRepository;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: AdminAttributeRepository::class)]
#[ORM\Table(name: 'phplist_admin_attribute')]
#[ORM\HasLifecycleCallbacks]
class AdminAttribute implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'name', type: 'string', length: 255)]
private string $name;
Expand Down Expand Up @@ -51,7 +55,7 @@ public function __construct(
$this->tableName = $tableName;
}

public function getId(): int
public function getId(): ?int
{
return $this->id;
}
Expand Down Expand Up @@ -86,33 +90,45 @@ public function getTableName(): ?string
return $this->tableName;
}

public function setName(string $name): void
public function setName(string $name): self
{
$this->name = $name;

return $this;
}

public function setType(?string $type): void
public function setType(?string $type): self
{
$this->type = $type;

return $this;
}

public function setListOrder(?int $listOrder): void
public function setListOrder(?int $listOrder): self
{
$this->listOrder = $listOrder;

return $this;
}

public function setDefaultValue(?string $defaultValue): void
public function setDefaultValue(?string $defaultValue): self
{
$this->defaultValue = $defaultValue;

return $this;
}

public function setRequired(?bool $required): void
public function setRequired(?bool $required): self
{
$this->required = $required;

return $this;
}

public function setTableName(?string $tableName): void
public function setTableName(?string $tableName): self
{
$this->tableName = $tableName;

return $this;
}
}
4 changes: 3 additions & 1 deletion src/Domain/Model/Identity/AdminAttributeRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public function getValue(): ?string
return $this->value;
}

public function setValue(?string $value): void
public function setValue(?string $value): self
{
$this->value = $value;

return $this;
}
}
13 changes: 11 additions & 2 deletions src/Domain/Model/Identity/AdminLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
use Doctrine\ORM\Mapping as ORM;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
use PhpList\Core\Domain\Model\Interfaces\Identity;
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
use PhpList\Core\Domain\Repository\Identity\AdminLoginRepository;
use Symfony\Component\Serializer\Attribute\Groups;

#[ORM\Entity(repositoryClass: AdminLoginRepository::class)]
#[ORM\Table(name: 'phplist_admin_login')]
#[ORM\HasLifecycleCallbacks]
class AdminLogin implements DomainModel, Identity
{
use IdentityTrait;
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue]
#[Groups(['SubscriberList', 'SubscriberListMembers'])]
private ?int $id = null;

#[ORM\Column(name: 'adminid', type: 'integer', options: ['unsigned' => true])]
private int $adminId;
Expand Down Expand Up @@ -49,6 +53,11 @@ public function __construct(
$this->sessionId = $sessionId;
}

public function getId(): ?int
{
return $this->id;
}

public function setActive(bool $active): self
{
$this->active = $active;
Expand Down
Loading
Loading