Neuron-PHP

Publisher
in package

Post publishing service.

Handles publishing draft posts.

Table of Contents

Properties

$_postRepository  : IPostRepository

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

Methods

publish()

Publish a draft post

public publish(Post $post) : Post
Parameters
$post : Post

The post to publish

Tags
throws
Exception

if post is already published or persistence fails

Return values
Post

schedule()

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
throws
Exception

if scheduled date is in the past or persistence fails

Return values
Post

unpublish()

Unpublish a post (revert to draft)

public unpublish(Post $post) : Post
Parameters
$post : Post

The post to unpublish

Tags
throws
Exception

if post is not published or persistence fails

Return values
Post

        
On this page

Search results