PHP Class Airship\Cabin\Hull\Blueprint\Blog

Read-only access to blog posts, etc. Create comments.
Inheritance: extends BlueprintGear
Show file Open project: paragonie/airship Class Usage Examples

Protected Properties

Property Type Description
$defaultSeparator Break after this token.

Public Methods

Method Description
addCommentToPost ( array $post, integer $blogPostId, boolean $published = false ) : boolean Adds a new comment to a blog post
checkCommentReplyTo ( integer $replyTo, integer $blogPostId ) : mixed Make sure we aren't replying to a comment on a different blog post
countByAuthor ( integer $authorId ) : integer Return an array of the most $num recent posts, including URL and title
countByCategories ( array $categories = [] ) : integer Return an array of the most $num recent posts, including URL and title
countByMonth ( string $year, string $month ) : integer Return an array of the most $num recent posts, including URL and title
countBySeries ( integer $seriesId ) : integer How many items are in this series?
countByTag ( integer $tag ) : integer Return an array of the most $num recent posts, including URL and title
countByYear ( string $year ) : integer Return an array of the most $num recent posts, including URL and title
countSeries ( ) : integer How many items are in this series?
expandCategory ( integer $category_id, integer $depth ) : array Expand a category to include all subcategories
getAuthor ( integer $authorId ) : array Return information about the current category
getAuthorBySlug ( string $authorSlug ) : array Return information about the current category
getAuthorsForUser ( integer $userId ) : array Get all of the authors available for this user to post under
getBlogMenu ( ) : array Gets the data necessary for the side menu on blog pages
getBlogPost ( string $year, string $month, string $slug ) : array Get a specific blog post
getBlogPostById ( integer $id ) : array Get a specific blog post by its row ID
getBlogPostByUniqueId ( string $uniqueID ) : array Given a unique ID (shorturl), return the blog post.
getBlogPostUniqueId ( integer $postID ) : string Given a blog post ID, just get the unique ID (shorturl)
getCategory ( string $slug ) : array Return information about the current category
getCategoryTree ( integer $parent ) : array Get all subcategories for a given category (defaults to root)
getCommentCache ( ) : CacheInterface Returns the cache container for blog comments:
getCommentDepth ( integer $commentId ) : integer
getCommentTree ( integer $blogPostId ) : array Get all of the blog comments for a given blog post
getCommentWithChildren ( integer $commentId ) : array Get a comment (and all of its replies)
getParentSeries ( integer $seriesId, array $seenIds = [], integer $depth ) : array Get all of the parent series that a series belongs to.
getPostTags ( integer $postId ) : array Get all of the tags for a particular post
getPostsSeries ( integer $postId ) : array Get all of the series' that this post belongs to:
getSeriesById ( integer $id ) : array Get information about a series
getSeriesForPost ( integer $postId ) : array Get all the series that a given post belongs to.
getSeriesInfo ( string $slug ) : array Get information about a series
getSnippet ( array $post, boolean $after = false ) : array Get a preview snippet of a blog post
getTag ( string $slug ) : array Return information about the current tag
getTagCloud ( ) : array Get $num of the most popular tags, paginated to start at $offset
getTags ( integer $num = 10, integer $offset ) : array Get $num of the most popular tags, paginated to start at $offset
listAllPublic ( ) : array Return all blog posts
listBaseSeries ( integer $num = 20, integer $offset ) : array Get all of the base series
listByAuthor ( integer $authorId, integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
listByCategories ( array $categories = [], integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
listByMonth ( string $year, string $month, integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
listBySeries ( integer $seriesId, integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
listByTag ( integer $tagId, integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
listByYear ( string $year, integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title
longURL ( string $shortURL = '' ) : string Get the long URL for a given short URL
recentFullPosts ( integer $num = 20, integer $offset ) : array Return an array of the most $num recent posts, including URL and title

Protected Methods

Method Description
getSeriesExtra ( array $ser ) : array Get extra data
getSeriesLink ( integer $series, integer $listOrder, string $which = 'curr' ) : string
getSeriesRecursive ( integer $seriesId, array $seen = [], integer $depth ) : array Recursively acquire parent series IDs into a flat array
postProcess ( array $post = [] ) : array Blog post database retrieval post-processing - D.R.Y.

Method Details

addCommentToPost() public method

Adds a new comment to a blog post
public addCommentToPost ( array $post, integer $blogPostId, boolean $published = false ) : boolean
$post array
$blogPostId integer
$published boolean
return boolean

checkCommentReplyTo() public method

Make sure we aren't replying to a comment on a different blog post
public checkCommentReplyTo ( integer $replyTo, integer $blogPostId ) : mixed
$replyTo integer
$blogPostId integer
return mixed

countByAuthor() public method

Return an array of the most $num recent posts, including URL and title
public countByAuthor ( integer $authorId ) : integer
$authorId integer
return integer

countByCategories() public method

Return an array of the most $num recent posts, including URL and title
public countByCategories ( array $categories = [] ) : integer
$categories array
return integer

countByMonth() public method

Return an array of the most $num recent posts, including URL and title
public countByMonth ( string $year, string $month ) : integer
$year string
$month string
return integer

countBySeries() public method

How many items are in this series?
public countBySeries ( integer $seriesId ) : integer
$seriesId integer
return integer

countByTag() public method

Return an array of the most $num recent posts, including URL and title
public countByTag ( integer $tag ) : integer
$tag integer
return integer

countByYear() public method

Return an array of the most $num recent posts, including URL and title
public countByYear ( string $year ) : integer
$year string
return integer

countSeries() public method

How many items are in this series?
public countSeries ( ) : integer
return integer

expandCategory() public method

Expand a category to include all subcategories
public expandCategory ( integer $category_id, integer $depth ) : array
$category_id integer
$depth integer
return array

getAuthor() public method

Return information about the current category
public getAuthor ( integer $authorId ) : array
$authorId integer
return array

getAuthorBySlug() public method

Return information about the current category
public getAuthorBySlug ( string $authorSlug ) : array
$authorSlug string
return array

getAuthorsForUser() public method

Get all of the authors available for this user to post under
public getAuthorsForUser ( integer $userId ) : array
$userId integer
return array

getBlogMenu() public method

Gets the data necessary for the side menu on blog pages
public getBlogMenu ( ) : array
return array

getBlogPost() public method

Get a specific blog post
public getBlogPost ( string $year, string $month, string $slug ) : array
$year string
$month string
$slug string
return array

getBlogPostById() public method

Get a specific blog post by its row ID
public getBlogPostById ( integer $id ) : array
$id integer
return array

getBlogPostByUniqueId() public method

Given a unique ID (shorturl), return the blog post.
public getBlogPostByUniqueId ( string $uniqueID ) : array
$uniqueID string
return array

getBlogPostUniqueId() public method

Given a blog post ID, just get the unique ID (shorturl)
public getBlogPostUniqueId ( integer $postID ) : string
$postID integer
return string

getCategory() public method

Return information about the current category
public getCategory ( string $slug ) : array
$slug string
return array

getCategoryTree() public method

Get all subcategories for a given category (defaults to root)
public getCategoryTree ( integer $parent ) : array
$parent integer
return array

getCommentCache() public method

Returns the cache container for blog comments:
public getCommentCache ( ) : CacheInterface
return CacheInterface

getCommentDepth() public method

public getCommentDepth ( integer $commentId ) : integer
$commentId integer
return integer

getCommentTree() public method

Get all of the blog comments for a given blog post
public getCommentTree ( integer $blogPostId ) : array
$blogPostId integer
return array

getCommentWithChildren() public method

Get a comment (and all of its replies)
public getCommentWithChildren ( integer $commentId ) : array
$commentId integer
return array

getParentSeries() public method

Get all of the parent series that a series belongs to.
public getParentSeries ( integer $seriesId, array $seenIds = [], integer $depth ) : array
$seriesId integer
$seenIds array
$depth integer
return array

getPostTags() public method

Get all of the tags for a particular post
public getPostTags ( integer $postId ) : array
$postId integer
return array

getPostsSeries() public method

Get all of the series' that this post belongs to:
public getPostsSeries ( integer $postId ) : array
$postId integer
return array

getSeriesById() public method

Get information about a series
public getSeriesById ( integer $id ) : array
$id integer
return array

getSeriesExtra() protected method

Get extra data
protected getSeriesExtra ( array $ser ) : array
$ser array
return array

getSeriesForPost() public method

Get all the series that a given post belongs to.
public getSeriesForPost ( integer $postId ) : array
$postId integer
return array

getSeriesInfo() public method

Get information about a series
public getSeriesInfo ( string $slug ) : array
$slug string
return array

getSeriesRecursive() protected method

Recursively acquire parent series IDs into a flat array
protected getSeriesRecursive ( integer $seriesId, array $seen = [], integer $depth ) : array
$seriesId integer
$seen array
$depth integer
return array

getSnippet() public method

Get a preview snippet of a blog post
public getSnippet ( array $post, boolean $after = false ) : array
$post array Post data
$after boolean Do we want the content after the fold?
return array

getTag() public method

Return information about the current tag
public getTag ( string $slug ) : array
$slug string
return array

getTagCloud() public method

Get $num of the most popular tags, paginated to start at $offset
public getTagCloud ( ) : array
return array

getTags() public method

Get $num of the most popular tags, paginated to start at $offset
public getTags ( integer $num = 10, integer $offset ) : array
$num integer
$offset integer
return array

listAllPublic() public method

Return all blog posts
public listAllPublic ( ) : array
return array

listBaseSeries() public method

Get all of the base series
public listBaseSeries ( integer $num = 20, integer $offset ) : array
$num integer
$offset integer
return array

listByAuthor() public method

Return an array of the most $num recent posts, including URL and title
public listByAuthor ( integer $authorId, integer $num = 20, integer $offset ) : array
$authorId integer
$num integer
$offset integer
return array

listByCategories() public method

Return an array of the most $num recent posts, including URL and title
public listByCategories ( array $categories = [], integer $num = 20, integer $offset ) : array
$categories array
$num integer
$offset integer
return array

listByMonth() public method

Return an array of the most $num recent posts, including URL and title
public listByMonth ( string $year, string $month, integer $num = 20, integer $offset ) : array
$year string
$month string
$num integer
$offset integer
return array

listBySeries() public method

Return an array of the most $num recent posts, including URL and title
public listBySeries ( integer $seriesId, integer $num = 20, integer $offset ) : array
$seriesId integer
$num integer
$offset integer
return array

listByTag() public method

Return an array of the most $num recent posts, including URL and title
public listByTag ( integer $tagId, integer $num = 20, integer $offset ) : array
$tagId integer
$num integer
$offset integer
return array

listByYear() public method

Return an array of the most $num recent posts, including URL and title
public listByYear ( string $year, integer $num = 20, integer $offset ) : array
$year string
$num integer
$offset integer
return array

longURL() public method

Get the long URL for a given short URL
public longURL ( string $shortURL = '' ) : string
$shortURL string
return string

postProcess() protected method

Blog post database retrieval post-processing - D.R.Y.
protected postProcess ( array $post = [] ) : array
$post array
return array

recentFullPosts() public method

Return an array of the most $num recent posts, including URL and title
public recentFullPosts ( integer $num = 20, integer $offset ) : array
$num integer
$offset integer
return array

Property Details

$defaultSeparator protected property

Break after this token.
protected $defaultSeparator