PHP 클래스 Backend\Modules\Blog\Engine\Model

파일 보기 프로젝트 열기: forkcms/forkcms 1 사용 예제들

공개 메소드들

메소드 설명
checkSettings ( ) : array Checks the settings and optionally returns an array with warnings
delete ( mixed $ids ) Deletes one or more items
deleteCategory ( integer $id ) Deletes a category
deleteCategoryAllowed ( integer $id ) : boolean Checks if it is allowed to delete the a category
deleteComments ( array $ids ) Deletes one or more comments
deleteSpamComments ( ) Delete all spam
exists ( integer $id ) : boolean Checks if an item exists
existsCategory ( integer $id ) : integer Checks if a category exists
existsComment ( integer $id ) : integer Checks if a comment exists
get ( integer $id ) : array Get all data for a given id
getAllCommentsForStatus ( string $status, integer $limit = 30, integer $offset ) : array Get the comments
getByTag ( integer $tagId ) : array Get all items by a given tag id
getCategories ( boolean $includeCount = false ) : array Get all categories
getCategory ( integer $id ) : array Get all data for a given id
getCategoryId ( string $title, string $language = null ) : integer Get a category id by title
getComment ( integer $id ) : array Get all data for a given id
getCommentStatusCount ( ) : array Get a count per comment
getComments ( array $ids ) : array Get multiple comments at once
getLatestComments ( string $status, integer $limit = 10 ) : array Get the latest comments for a given type
getMaximumId ( ) : integer Get the maximum id
getRevision ( integer $id, integer $revisionId ) : array Get all data for a given revision
getURL ( string $url, integer $id = null ) : string Retrieve the unique URL for an item
getURLForCategory ( string $url, integer $id = null ) : string Retrieve the unique URL for a category
insert ( array $item ) : integer Inserts an item into the database
insertCategory ( array $item, array $meta = null ) : integer Inserts a new category into the database
insertComment ( array $comment ) : integer Inserts a new comment (Taken from FrontendBlogModel)
insertCompletePost ( array $item, array $meta = [], array $tags = [], array $comments = [] ) : integer Inserts a complete post item based on some arrays of data
reCalculateCommentCount ( array $ids ) : boolean Recalculate the commentcount
update ( array $item ) : integer Update an existing item
updateCategory ( array $item, array $meta = null ) : integer Update an existing category
updateComment ( array $item ) : integer Update an existing comment
updateCommentStatuses ( array $ids, string $status ) Updates one or more comments' status
updateRevision ( $revision_id, $item ) Update a page revision without generating a new revision.

메소드 상세

checkSettings() 공개 정적인 메소드

Checks the settings and optionally returns an array with warnings
public static checkSettings ( ) : array
리턴 array

delete() 공개 정적인 메소드

Deletes one or more items
public static delete ( mixed $ids )
$ids mixed The ids to delete.

deleteCategory() 공개 정적인 메소드

Deletes a category
public static deleteCategory ( integer $id )
$id integer The id of the category to delete.

deleteCategoryAllowed() 공개 정적인 메소드

Checks if it is allowed to delete the a category
public static deleteCategoryAllowed ( integer $id ) : boolean
$id integer The id of the category.
리턴 boolean

deleteComments() 공개 정적인 메소드

Deletes one or more comments
public static deleteComments ( array $ids )
$ids array The id(s) of the items(s) to delete.

deleteSpamComments() 공개 정적인 메소드

Delete all spam
public static deleteSpamComments ( )

exists() 공개 정적인 메소드

Checks if an item exists
public static exists ( integer $id ) : boolean
$id integer The id of the item to check for existence.
리턴 boolean

existsCategory() 공개 정적인 메소드

Checks if a category exists
public static existsCategory ( integer $id ) : integer
$id integer The id of the category to check for existence.
리턴 integer

existsComment() 공개 정적인 메소드

Checks if a comment exists
public static existsComment ( integer $id ) : integer
$id integer The id of the item to check for existence.
리턴 integer

get() 공개 정적인 메소드

Get all data for a given id
public static get ( integer $id ) : array
$id integer The Id of the item to fetch?
리턴 array

getAllCommentsForStatus() 공개 정적인 메소드

Get the comments
public static getAllCommentsForStatus ( string $status, integer $limit = 30, integer $offset ) : array
$status string The type of comments to get.
$limit integer The maximum number of items to retrieve.
$offset integer The offset.
리턴 array

getByTag() 공개 정적인 메소드

Get all items by a given tag id
public static getByTag ( integer $tagId ) : array
$tagId integer The id of the tag.
리턴 array

getCategories() 공개 정적인 메소드

Get all categories
public static getCategories ( boolean $includeCount = false ) : array
$includeCount boolean Include the count?
리턴 array

getCategory() 공개 정적인 메소드

Get all data for a given id
public static getCategory ( integer $id ) : array
$id integer The id of the category to fetch.
리턴 array

getCategoryId() 공개 정적인 메소드

Get a category id by title
public static getCategoryId ( string $title, string $language = null ) : integer
$title string The title of the category.
$language string The language to use, if not provided we will use the working language.
리턴 integer

getComment() 공개 정적인 메소드

Get all data for a given id
public static getComment ( integer $id ) : array
$id integer The Id of the comment to fetch?
리턴 array

getCommentStatusCount() 공개 정적인 메소드

Get a count per comment
public static getCommentStatusCount ( ) : array
리턴 array

getComments() 공개 정적인 메소드

Get multiple comments at once
public static getComments ( array $ids ) : array
$ids array The id(s) of the comment(s).
리턴 array

getLatestComments() 공개 정적인 메소드

Get the latest comments for a given type
public static getLatestComments ( string $status, integer $limit = 10 ) : array
$status string The status for the comments to retrieve.
$limit integer The maximum number of items to retrieve.
리턴 array

getMaximumId() 공개 정적인 메소드

Get the maximum id
public static getMaximumId ( ) : integer
리턴 integer

getRevision() 공개 정적인 메소드

Get all data for a given revision
public static getRevision ( integer $id, integer $revisionId ) : array
$id integer The id of the item.
$revisionId integer The revision to get.
리턴 array

getURL() 공개 정적인 메소드

Retrieve the unique URL for an item
public static getURL ( string $url, integer $id = null ) : string
$url string The URL to base on.
$id integer The id of the item to ignore.
리턴 string

getURLForCategory() 공개 정적인 메소드

Retrieve the unique URL for a category
public static getURLForCategory ( string $url, integer $id = null ) : string
$url string The string whereon the URL will be based.
$id integer The id of the category to ignore.
리턴 string

insert() 공개 정적인 메소드

Inserts an item into the database
public static insert ( array $item ) : integer
$item array The data to insert.
리턴 integer

insertCategory() 공개 정적인 메소드

Inserts a new category into the database
public static insertCategory ( array $item, array $meta = null ) : integer
$item array The data for the category to insert.
$meta array The metadata for the category to insert.
리턴 integer

insertComment() 공개 정적인 메소드

Inserts a new comment (Taken from FrontendBlogModel)
public static insertComment ( array $comment ) : integer
$comment array The comment to add.
리턴 integer

insertCompletePost() 공개 정적인 메소드

This method's purpose is to be able to insert a post (possibly with all its metadata, tags, and comments) in one method call. As much data as possible has been made optional, to be able to do imports where only fractions of the data we need are known. The item array should have at least a 'title' and a 'text' property other properties are optional. The meta array has only optional properties. You can use these to override the defaults. The tags array is just a list of tagnames as string. The comments array is an array of arrays with comment properties. A comment should have at least 'author', 'email', and 'text' properties.
public static insertCompletePost ( array $item, array $meta = [], array $tags = [], array $comments = [] ) : integer
$item array The data to insert.
$meta array The metadata to insert.
$tags array The tags to connect to this post.
$comments array The comments attached to this post.
리턴 integer

reCalculateCommentCount() 공개 정적인 메소드

Recalculate the commentcount
public static reCalculateCommentCount ( array $ids ) : boolean
$ids array The id(s) of the post wherefore the commentcount should be recalculated.
리턴 boolean

update() 공개 정적인 메소드

Update an existing item
public static update ( array $item ) : integer
$item array The new data.
리턴 integer

updateCategory() 공개 정적인 메소드

Update an existing category
public static updateCategory ( array $item, array $meta = null ) : integer
$item array The new data.
$meta array The new meta-data.
리턴 integer

updateComment() 공개 정적인 메소드

Update an existing comment
public static updateComment ( array $item ) : integer
$item array The new data.
리턴 integer

updateCommentStatuses() 공개 정적인 메소드

Updates one or more comments' status
public static updateCommentStatuses ( array $ids, string $status )
$ids array The id(s) of the comment(s) to change the status for.
$status string The new status.

updateRevision() 공개 정적인 메소드

Needed to add an image to a page.
public static updateRevision ( $revision_id, $item )
$revision_id
$item