Replace NewsletterLink with NewsletterLinkEntity in the class Links
It was also necessary to update two NewsletterTest tests, as after the change to Links::save(), having a queue ID set became mandatory (before it was not and one was not set properly in the mock SendingQueue object). [MAILPOET-3816]
This commit is contained in:
@@ -99,4 +99,16 @@ class NewsletterLinkEntity {
|
||||
public function getTotalClicksCount() {
|
||||
return $this->clicks->count();
|
||||
}
|
||||
|
||||
public function toArray(): array {
|
||||
return [
|
||||
'id' => $this->getId(),
|
||||
'newsletter_id' => ($this->getNewsletter() instanceof NewsletterEntity) ? $this->getNewsletter()->getId() : null,
|
||||
'queue_id' => ($this->getQueue() instanceof SendingQueueEntity) ? $this->getQueue()->getId() : null,
|
||||
'url' => $this->getUrl(),
|
||||
'hash' => $this->getHash(),
|
||||
'created_at' => $this->getCreatedAt(),
|
||||
'updated_at' => $this->getUpdatedAt(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user