PHP Класс Backend\Modules\Blog\Engine\Model

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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