Use the latest updated queue
[MAILPOET-3876]
This commit is contained in:
@ -454,16 +454,20 @@ class NewsletterEntity {
|
||||
return $this->queues;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SendingQueueEntity|null
|
||||
*/
|
||||
public function getLatestQueue() {
|
||||
public function getLatestQueue(): ?SendingQueueEntity {
|
||||
$criteria = new Criteria();
|
||||
$criteria->orderBy(['id' => Criteria::DESC]);
|
||||
$criteria->setMaxResults(1);
|
||||
return $this->queues->matching($criteria)->first() ?: null;
|
||||
}
|
||||
|
||||
public function getLastUpdatedQueue(): ?SendingQueueEntity {
|
||||
$criteria = new Criteria();
|
||||
$criteria->orderBy(['updatedAt' => Criteria::DESC]);
|
||||
$criteria->setMaxResults(1);
|
||||
return $this->queues->matching($criteria)->first() ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, SendingQueueEntity>
|
||||
*/
|
||||
|
Reference in New Issue
Block a user