Publisher
in package
Post publishing service.
Handles publishing draft posts.
Table of Contents
Properties
Methods
- __construct() : mixed
- publish() : Post
- Publish a draft post
- schedule() : Post
- Schedule a post for future publication
- unpublish() : Post
- Unpublish a post (revert to draft)
Properties
$_postRepository
private
IPostRepository
$_postRepository
Methods
__construct()
public
__construct(IPostRepository $postRepository) : mixed
Parameters
- $postRepository : IPostRepository
publish()
Publish a draft post
public
publish(Post $post) : Post
Parameters
- $post : Post
-
The post to publish
Tags
Return values
Postschedule()
Schedule a post for future publication
public
schedule(Post $post, DateTimeImmutable $publishAt) : Post
Parameters
- $post : Post
-
The post to schedule
- $publishAt : DateTimeImmutable
-
When to publish
Tags
Return values
Postunpublish()
Unpublish a post (revert to draft)
public
unpublish(Post $post) : Post
Parameters
- $post : Post
-
The post to unpublish