Use doctrine for latest post fetching
[MAILPOET-2899]
This commit is contained in:
@ -10,9 +10,4 @@ namespace MailPoet\Models;
|
||||
class NewsletterPost extends Model {
|
||||
public static $_table = MP_NEWSLETTER_POSTS_TABLE; // phpcs:ignore PSR2.Classes.PropertyDeclaration
|
||||
|
||||
public static function getNewestNewsletterPost($newsletterId) {
|
||||
return self::where('newsletter_id', $newsletterId)
|
||||
->orderByDesc('created_at')
|
||||
->findOne();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user