Move logic for if a post should be pushed

References #328
This commit is contained in:
Oliver Davies 2021-01-10 16:17:04 +00:00
parent baebc4fd25
commit 73271de39a
2 changed files with 21 additions and 20 deletions

View file

@ -48,24 +48,4 @@ final class PushBlogPostToSocialMedia implements EventSubscriberInterface {
]);
}
private function shouldBePushed(Post $post): bool {
if ($post->isExternalPost()) {
return FALSE;
}
if (!$post->isPublished()) {
return FALSE;
}
if (!$post->shouldSendToSocialMedia()) {
return FALSE;
}
if ($post->hasBeenSentToSocialMedia()) {
return FALSE;
}
return TRUE;
}
}