PHP 클래스 Airship\Cabin\Bridge\Blueprint\Blog

Blog posts, categories, series, tags.
상속: extends BlueprintGear, use trait Common, use trait Orderable, use trait Slug, use trait Airship\Engine\Bolt\Cache
파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cabin Cabin for this blog post (used as a default parameter)

공개 메소드들

메소드 설명
categoryDescendsFrom ( integer $newParent, integer $categoryId ) : boolean Sanity check; don't allow a category to belong to one of its children.
createCategory ( array $post ) : boolean Create a new category
createPost ( array $post, boolean $publish = false ) : boolean Create (and, optionally, publish) a new blog post.
createSeries ( array $post ) : boolean Inserts a new series, and the subsequent items, in the database
createTag ( array $post ) : boolean Create a new tag
deleteCategory ( integer $categoryID, integer $moveChildrenTo ) : boolean Delete a category and move all related content
deleteComment ( integer $commentId ) : boolean Delete this comment and all of its revision history.
deletePost ( array $formData, array $blogPost = [] ) : boolean Delete a blog post
deleteSeries ( integer $seriesId ) : boolean Permanently remove a blog post series.
editTag ( integer $tagId, array $post ) : boolean Rename a tag
getAllSeries ( integer $offset, integer $limit ) : array Get all of the series (paginated)
getAllSeriesParents ( array $seriesIds, integer $depth ) : array Get all of the series that this series belongs to, recursively.
getBlogPostById ( integer $postId ) : array Get information about a blog post
getBlogPostLatestVersion ( integer $postId ) : array Get the latest version of a blog post
getBlogPostVersionByUniqueId ( string $uniqueID ) : array Get a specific blog post version, given a unique ID
getBlogPostVersions ( integer $postId ) : array
getCategoryInfo ( integer $categoryId ) : array Get a category
getCategoryParents ( integer $categoryId, integer $depth ) : array Get all of a category's parents
getCategoryTree ( integer $parent = null, string $col = 'children', array $seen = [], integer $depth ) : array Get a full category tree, recursively, from a given parent
getCommentById ( integer $commentId, boolean $includeReplyTo = true ) : array Get a blog comment
getNextVersionUniqueId ( integer $postId, integer $currentVersionId ) : string Get the next version's unique ID
getPrevVersionUniqueId ( integer $postId, integer $currentVersionId ) : string Get the previous version's unique ID
getSeries ( integer $seriesId ) : array Get a single series
getSeriesForAuthor ( integer $authorId, array $exclude = [] ) : array Get all of the series for a particular author
getSeriesForUser ( integer $userId, integer $offset, integer $limit ) : array Get all of the series for all of the authors the user owns
getSeriesItems ( integer $seriesId ) : array Get a single series
getSeriesTree ( integer $current = null, string $col = 'children', array $encountered = [], integer $depth ) : array Get a full series tree, recursively, from a given parent
getTagInfo ( integer $tagId ) : array Get data on a specific tag
getTags ( ) : array Get all of the tags in the database
getTagsForPost ( integer $postId ) : array Get a list of all selected blog posts
hideComment ( integer $commentId ) : boolean Make a comment invisible on blog posts.
listComments ( integer $offset, integer $limit = 20 ) : array List comments
listPosts ( boolean $showAll = false, integer $offset, integer $limit = 20 ) : array Get the most recent posts
listPostsForAuthor ( integer $authorId, array $exclude = [] ) : array Get all of the series for a particular author
listTags ( integer $offset, integer $limit, string $sort = 'name', boolean $desc = false ) : array List tags (paginated, sortable).
numComments ( mixed $published = null ) : integer Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
numItemsInSeries ( integer $seriesId ) : integer Get the number of items in a given series.
numPosts ( mixed $published = null ) : integer Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
numSeries ( ) : integer Count the number of series in the database
numSeriesForUser ( integer $userId ) : integer Count the number of series for a user
numTags ( ) : integer Count the number of tags
publishComment ( integer $commentId ) : boolean Publish an unapproved blog comment.
updateCategory ( integer $id, array $post ) : boolean Update a blog category
updateCategorySlug ( integer $id, array $post ) : boolean
updatePost ( array $post, array $old, boolean $publish = false ) : boolean Update a blog post
updateSeries ( integer $seriesId, array $oldItems, array $post ) : boolean Insert/delete/rearrange the contents of a series.

보호된 메소드들

메소드 설명
makeBlogPostSlug ( string $title, string $year = '', string $month = '' ) : string Make a generic slug for most tables

메소드 상세

categoryDescendsFrom() 공개 메소드

Returns TRUE if this check is violated.
public categoryDescendsFrom ( integer $newParent, integer $categoryId ) : boolean
$newParent integer
$categoryId integer
리턴 boolean

createCategory() 공개 메소드

Create a new category
public createCategory ( array $post ) : boolean
$post array
리턴 boolean

createPost() 공개 메소드

Create (and, optionally, publish) a new blog post.
public createPost ( array $post, boolean $publish = false ) : boolean
$post array
$publish boolean
리턴 boolean

createSeries() 공개 메소드

Inserts a new series, and the subsequent items, in the database
public createSeries ( array $post ) : boolean
$post array
리턴 boolean

createTag() 공개 메소드

Create a new tag
public createTag ( array $post ) : boolean
$post array
리턴 boolean

deleteCategory() 공개 메소드

Delete a category and move all related content
public deleteCategory ( integer $categoryID, integer $moveChildrenTo ) : boolean
$categoryID integer
$moveChildrenTo integer
리턴 boolean

deleteComment() 공개 메소드

Delete this comment and all of its revision history.
public deleteComment ( integer $commentId ) : boolean
$commentId integer
리턴 boolean

deletePost() 공개 메소드

Delete a blog post
public deletePost ( array $formData, array $blogPost = [] ) : boolean
$formData array
$blogPost array
리턴 boolean

deleteSeries() 공개 메소드

Permanently remove a blog post series.
public deleteSeries ( integer $seriesId ) : boolean
$seriesId integer
리턴 boolean

editTag() 공개 메소드

Rename a tag
public editTag ( integer $tagId, array $post ) : boolean
$tagId integer
$post array
리턴 boolean

getAllSeries() 공개 메소드

Get all of the series (paginated)
public getAllSeries ( integer $offset, integer $limit ) : array
$offset integer
$limit integer
리턴 array

getAllSeriesParents() 공개 메소드

This is mostly used for generating the appropriate "prev/next" links on the View Blog Post page.
public getAllSeriesParents ( array $seriesIds, integer $depth ) : array
$seriesIds array
$depth integer
리턴 array

getBlogPostById() 공개 메소드

Get information about a blog post
public getBlogPostById ( integer $postId ) : array
$postId integer
리턴 array

getBlogPostLatestVersion() 공개 메소드

Get the latest version of a blog post
public getBlogPostLatestVersion ( integer $postId ) : array
$postId integer
리턴 array

getBlogPostVersionByUniqueId() 공개 메소드

Get a specific blog post version, given a unique ID
public getBlogPostVersionByUniqueId ( string $uniqueID ) : array
$uniqueID string
리턴 array

getBlogPostVersions() 공개 메소드

public getBlogPostVersions ( integer $postId ) : array
$postId integer
리턴 array

getCategoryInfo() 공개 메소드

Get a category
public getCategoryInfo ( integer $categoryId ) : array
$categoryId integer
리턴 array

getCategoryParents() 공개 메소드

Get all of a category's parents
public getCategoryParents ( integer $categoryId, integer $depth ) : array
$categoryId integer
$depth integer
리턴 array

getCategoryTree() 공개 메소드

Get a full category tree, recursively, from a given parent
public getCategoryTree ( integer $parent = null, string $col = 'children', array $seen = [], integer $depth ) : array
$parent integer
$col string The "children" column name
$seen array
$depth integer How deep are we?
리턴 array

getCommentById() 공개 메소드

Get a blog comment
public getCommentById ( integer $commentId, boolean $includeReplyTo = true ) : array
$commentId integer
$includeReplyTo boolean Also grab the parent comment?
리턴 array

getNextVersionUniqueId() 공개 메소드

Get the next version's unique ID
public getNextVersionUniqueId ( integer $postId, integer $currentVersionId ) : string
$postId integer
$currentVersionId integer
리턴 string

getPrevVersionUniqueId() 공개 메소드

Get the previous version's unique ID
public getPrevVersionUniqueId ( integer $postId, integer $currentVersionId ) : string
$postId integer
$currentVersionId integer
리턴 string

getSeries() 공개 메소드

Get a single series
public getSeries ( integer $seriesId ) : array
$seriesId integer
리턴 array

getSeriesForAuthor() 공개 메소드

Get all of the series for a particular author
public getSeriesForAuthor ( integer $authorId, array $exclude = [] ) : array
$authorId integer
$exclude array Series IDs to exclude
리턴 array

getSeriesForUser() 공개 메소드

Get all of the series for all of the authors the user owns
public getSeriesForUser ( integer $userId, integer $offset, integer $limit ) : array
$userId integer
$offset integer
$limit integer
리턴 array

getSeriesItems() 공개 메소드

Get a single series
public getSeriesItems ( integer $seriesId ) : array
$seriesId integer
리턴 array

getSeriesTree() 공개 메소드

Get a full series tree, recursively, from a given parent
public getSeriesTree ( integer $current = null, string $col = 'children', array $encountered = [], integer $depth ) : array
$current integer
$col string The "children" column name
$encountered array Which IDs have we seen before?
$depth integer How deep are we?
리턴 array

getTagInfo() 공개 메소드

Get data on a specific tag
public getTagInfo ( integer $tagId ) : array
$tagId integer
리턴 array

getTags() 공개 메소드

Get all of the tags in the database
public getTags ( ) : array
리턴 array

getTagsForPost() 공개 메소드

Get a list of all selected blog posts
public getTagsForPost ( integer $postId ) : array
$postId integer
리턴 array

hideComment() 공개 메소드

Make a comment invisible on blog posts.
public hideComment ( integer $commentId ) : boolean
$commentId integer
리턴 boolean

listComments() 공개 메소드

List comments
public listComments ( integer $offset, integer $limit = 20 ) : array
$offset integer
$limit integer
리턴 array

listPosts() 공개 메소드

Get the most recent posts
public listPosts ( boolean $showAll = false, integer $offset, integer $limit = 20 ) : array
$showAll boolean
$offset integer
$limit integer
리턴 array

listPostsForAuthor() 공개 메소드

Get all of the series for a particular author
public listPostsForAuthor ( integer $authorId, array $exclude = [] ) : array
$authorId integer
$exclude array Series IDs to exclude
리턴 array

listTags() 공개 메소드

List tags (paginated, sortable).
public listTags ( integer $offset, integer $limit, string $sort = 'name', boolean $desc = false ) : array
$offset integer
$limit integer
$sort string
$desc boolean
리턴 array

makeBlogPostSlug() 보호된 메소드

Make a generic slug for most tables
protected makeBlogPostSlug ( string $title, string $year = '', string $month = '' ) : string
$title string What are we basing the URL off of?
$year string
$month string
리턴 string

numComments() 공개 메소드

Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
public numComments ( mixed $published = null ) : integer
$published mixed
리턴 integer

numItemsInSeries() 공개 메소드

Get the number of items in a given series.
public numItemsInSeries ( integer $seriesId ) : integer
$seriesId integer
리턴 integer

numPosts() 공개 메소드

Count the number of posts. trinary: NULL -> all posts TRUE -> all published posts FALSE -> all unpublished posts
public numPosts ( mixed $published = null ) : integer
$published mixed
리턴 integer

numSeries() 공개 메소드

Count the number of series in the database
public numSeries ( ) : integer
리턴 integer

numSeriesForUser() 공개 메소드

Count the number of series for a user
public numSeriesForUser ( integer $userId ) : integer
$userId integer
리턴 integer

numTags() 공개 메소드

Count the number of tags
public numTags ( ) : integer
리턴 integer

publishComment() 공개 메소드

Publish an unapproved blog comment.
public publishComment ( integer $commentId ) : boolean
$commentId integer
리턴 boolean

updateCategory() 공개 메소드

Update a blog category
public updateCategory ( integer $id, array $post ) : boolean
$id integer
$post array
리턴 boolean

updateCategorySlug() 공개 메소드

public updateCategorySlug ( integer $id, array $post ) : boolean
$id integer
$post array
리턴 boolean

updatePost() 공개 메소드

Update a blog post
public updatePost ( array $post, array $old, boolean $publish = false ) : boolean
$post array
$old array
$publish boolean
리턴 boolean

updateSeries() 공개 메소드

Insert/delete/rearrange the contents of a series.
public updateSeries ( integer $seriesId, array $oldItems, array $post ) : boolean
$seriesId integer
$oldItems array
$post array
리턴 boolean

프로퍼티 상세

$cabin 보호되어 있는 프로퍼티

Cabin for this blog post (used as a default parameter)
protected $cabin