Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
"name": "Xheni Myrtaj",
"email": "xheni@phplist.com",
"role": "Maintainer"
"role": "Former developer"
},
{
"name": "Oliver Klee",
Expand All @@ -25,6 +25,11 @@
"name": "Sam Tuke",
"email": "mail@samtuke.com",
"role": "Former developer"
},
{
"name": "Tatevik Grigoryan",
"email": "tatevik@phplist.com",
"role": "Maintainer"
}
],
"support": {
Expand Down
10 changes: 5 additions & 5 deletions src/Domain/Model/Messaging/Message/MessageFormat.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ class MessageFormat implements EmbeddableInterface
#[ORM\Column(name: 'sendformat', type: 'string', length: 20, nullable: true)]
private ?string $sendFormat = null;

#[ORM\Column(name: 'astext', type: 'integer', options: ['default' => 0])]
#[ORM\Column(name: 'astext', type: 'boolean', options: ['default' => false])]
private bool $asText = false;

#[ORM\Column(name: 'ashtml', type: 'integer', options: ['default' => 0])]
#[ORM\Column(name: 'ashtml', type: 'boolean', options: ['default' => false])]
private bool $asHtml = false;

#[ORM\Column(name: 'aspdf', type: 'integer', options: ['default' => 0])]
#[ORM\Column(name: 'aspdf', type: 'boolean', options: ['default' => false])]
private bool $asPdf = false;

#[ORM\Column(name: 'astextandhtml', type: 'integer', options: ['default' => 0])]
#[ORM\Column(name: 'astextandhtml', type: 'boolean', options: ['default' => false])]
private bool $asTextAndHtml = false;

#[ORM\Column(name: 'astextandpdf', type: 'integer', options: ['default' => 0])]
#[ORM\Column(name: 'astextandpdf', type: 'boolean', options: ['default' => false])]
private bool $asTextAndPdf = false;

public const FORMAT_TEXT = 'text';
Expand Down
4 changes: 2 additions & 2 deletions src/Domain/Model/Messaging/TemplateImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class TemplateImage implements DomainModel, Identity
#[ORM\GeneratedValue]
private ?int $id = null;

#[ORM\ManyToOne(targetEntity: Template::class)]
#[ORM\JoinColumn(name: 'template', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: Template::class, inversedBy: 'images')]
#[ORM\JoinColumn(name: 'template', referencedColumnName: 'id', nullable: false)]
private Template $template;

#[ORM\Column(name: 'mimetype', type: 'string', length: 100, nullable: true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Model/Subscription/SubscriberAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SubscriberAttribute implements DomainModel
private SubscriberAttributeDefinition $attributeDefinition;

#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Subscriber::class)]
#[ORM\ManyToOne(targetEntity: Subscriber::class, inversedBy: 'attributes')]
#[ORM\JoinColumn(name: 'userid', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private Subscriber $subscriber;

Expand Down
10 changes: 0 additions & 10 deletions src/Domain/Repository/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace PhpList\Core\Domain\Repository;

use Doctrine\ORM\EntityRepository;
use LogicException;
use PhpList\Core\Domain\Model\Interfaces\DomainModel;

/**
Expand Down Expand Up @@ -49,13 +48,4 @@ public function remove(DomainModel $model): void
$this->getEntityManager()->remove($model);
$this->getEntityManager()->flush();
}

public function getAlias(): string
{
if (!$this->alias) {
throw new LogicException('Alias not set in repository: ' . static::class);
}

return $this->alias;
}
}
2 changes: 1 addition & 1 deletion src/Domain/Repository/Messaging/MessageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getByOwnerId(int $ownerId): array
/** @return Message[] */
public function getFilteredAfterId(int $lastId, int $limit, ?FilterRequestInterface $filter = null): array
{
$queryBuilder = $this->createQueryBuilder($this->getAlias());
$queryBuilder = $this->createQueryBuilder('m');

if ($filter instanceof MessageFilter && $filter->getOwner() !== null) {
$queryBuilder->andWhere('IDENTITY(m.owner) = :ownerId')
Expand Down
5 changes: 0 additions & 5 deletions tests/Unit/Domain/Repository/DummyRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public function __construct(private readonly QueryBuilder $queryBuilder)
{
}

public function getAlias(): string
{
return 'dummy';
}

/** Doctrine normally injects the QB through $this->createQueryBuilder(). */
protected function createQueryBuilder(string $alias): QueryBuilder
{
Expand Down
Loading