PHP Class SevenShores\Hubspot\Resources\BlogPosts

Inheritance: extends Resource
Show file Open project: fungku/hubspot-php

Public Methods

Method Description
all ( array $params = [] ) : Response Get all blog posts.
clonePost ( integer $id ) : Response Clone the blog post.
create ( array $params = [] ) : Response Create a new blog post.
delete ( integer $id ) : Response Delete a blog post.
getAutoSaveBufferContents ( integer $id ) : Response Gets the current contents of the auto-save buffer.
getById ( integer $id ) : Response Get a specific blog post.
getVersion ( integer $post_id, integer $version_id ) : Response Get a previous version of the blog post.
hasBufferedChanges ( integer $id ) : Response Determine if the auto-save buffer differs from the live blog post.
publishAction ( integer $id, string $action ) : Response Either publishes or cancels publishing based on the POSTed JSON.
pushBufferLive ( integer $id ) : Response Copies the contents of the auto-save buffer into the live blog post.
restoreDeleted ( integer $id ) : Response Restores a previously deleted blog post.
restoreVersion ( integer $post_id, integer $version_id ) : Response Restore a previous version of the blog post.
update ( integer $id, array $params = [] ) : Response Update a blog post.
updateAutoSaveBuffer ( integer $id, array $params = [] ) : Response Updates the auto-save buffer. Live objects will not be impacted.
validateBuffer ( integer $id ) : Response Validates the auto-save buffer version of the blog post.
versions ( integer $id ) : Response List previous versions of the blog post.

Method Details

all() public method

Get all blog posts.
public all ( array $params = [] ) : Response
$params array Optional parameters.
return SevenShores\Hubspot\Http\Response

clonePost() public method

Clone the blog post.
public clonePost ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

create() public method

Create a new blog post.
public create ( array $params = [] ) : Response
$params array Optional Parameters.
return SevenShores\Hubspot\Http\Response

delete() public method

Delete a blog post.
public delete ( integer $id ) : Response
$id integer
return SevenShores\Hubspot\Http\Response

getAutoSaveBufferContents() public method

Gets the current contents of the auto-save buffer.
public getAutoSaveBufferContents ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

getById() public method

Get a specific blog post.
public getById ( integer $id ) : Response
$id integer
return SevenShores\Hubspot\Http\Response

getVersion() public method

Get a previous version of the blog post.
public getVersion ( integer $post_id, integer $version_id ) : Response
$post_id integer The blog post ID
$version_id integer The version ID
return SevenShores\Hubspot\Http\Response

hasBufferedChanges() public method

Determine if the auto-save buffer differs from the live blog post.
public hasBufferedChanges ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

publishAction() public method

Allowable actions are: "push-buffer-live", "schedule-publish", "cancel-publish". "push-buffer-live": copies the current contents of the auto-save buffer into the live object. "schedule-publish": which pushes the buffer live and then sets up the content for publishing at the existing publish_date time. "cancel-publish": cancels a previous schedule-publish action.
public publishAction ( integer $id, string $action ) : Response
$id integer The blog post ID
$action string The publish action
return SevenShores\Hubspot\Http\Response

pushBufferLive() public method

Copies the contents of the auto-save buffer into the live blog post.
public pushBufferLive ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

restoreDeleted() public method

Restores a previously deleted blog post.
public restoreDeleted ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

restoreVersion() public method

Restore a previous version of the blog post.
public restoreVersion ( integer $post_id, integer $version_id ) : Response
$post_id integer The blog post ID
$version_id integer The version ID
return SevenShores\Hubspot\Http\Response

update() public method

Update a blog post.
public update ( integer $id, array $params = [] ) : Response
$id integer The blog post id.
$params array The blog post fields to update.
return SevenShores\Hubspot\Http\Response

updateAutoSaveBuffer() public method

Updates the auto-save buffer. Live objects will not be impacted.
See also: http://developers.hubspot.com/docs/methods/blogv2/put_blog_posts_blog_post_id_buffer
public updateAutoSaveBuffer ( integer $id, array $params = [] ) : Response
$id integer The blog post ID.
$params array Allowed parameters.
return SevenShores\Hubspot\Http\Response

validateBuffer() public method

Validates the auto-save buffer version of the blog post.
public validateBuffer ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response

versions() public method

List previous versions of the blog post.
public versions ( integer $id ) : Response
$id integer The blog post ID
return SevenShores\Hubspot\Http\Response