PHP Class Frontend\Modules\Blog\Engine\Model

Inheritance: implements Frontend\Modules\Tags\Engine\TagsInterface
Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
get ( string $url ) : array Get an item
getAll ( integer $limit = 10, integer $offset ) : array Get all items (at least a chunk)
getAllCategories ( ) : array Get all categories used
getAllComments ( integer $limit = 10, integer $offset ) : array Get all comments (at least a chunk)
getAllCount ( ) : integer Get the number of items
getAllForCategory ( string $categoryURL, integer $limit = 10, integer $offset ) : array Get all items in a category (at least a chunk)
getAllForCategoryCount ( string $url ) : integer Get the number of items in a given category
getAllForDateRange ( integer $start, integer $end, integer $limit = 10, integer $offset ) : array Get all items between a start and end-date
getAllForDateRangeCount ( integer $start, integer $end ) : integer Get the number of items in a date range
getArchiveNumbers ( ) : array Get the statistics for the archive
getComments ( integer $id ) : array Get the comments for an item
getForTags ( array $ids ) : array Fetch the list of tags for a list of items
getIdForTags ( Url $url ) : integer Get the id of an item by the full URL of the current page.
getNavigation ( integer $id ) : array Get an array with the previous and the next post
getRecentComments ( integer $limit = 5 ) : array Get recent comments
getRelated ( integer $id, integer $limit = 5 ) : array Get related items based on tags
getRevision ( string $url, integer $revision ) : array Get a revision for an item
insertComment ( array $comment ) : integer Inserts a new comment
isModerated ( string $author, string $email ) : boolean Get moderation status for an author
notifyAdmin ( array $comment ) Notify the admin
search ( array $ids ) : array Parse the search results for this module

Method Details

get() public static method

Get an item
public static get ( string $url ) : array
$url string The URL for the item.
return array

getAll() public static method

Get all items (at least a chunk)
public static getAll ( integer $limit = 10, integer $offset ) : array
$limit integer The number of items to get.
$offset integer The offset.
return array

getAllCategories() public static method

Get all categories used
public static getAllCategories ( ) : array
return array

getAllComments() public static method

Get all comments (at least a chunk)
public static getAllComments ( integer $limit = 10, integer $offset ) : array
$limit integer The number of items to get.
$offset integer The offset.
return array

getAllCount() public static method

Get the number of items
public static getAllCount ( ) : integer
return integer

getAllForCategory() public static method

Get all items in a category (at least a chunk)
public static getAllForCategory ( string $categoryURL, integer $limit = 10, integer $offset ) : array
$categoryURL string The URL of the category to retrieve the posts for.
$limit integer The number of items to get.
$offset integer The offset.
return array

getAllForCategoryCount() public static method

Get the number of items in a given category
public static getAllForCategoryCount ( string $url ) : integer
$url string The URL for the category.
return integer

getAllForDateRange() public static method

Get all items between a start and end-date
public static getAllForDateRange ( integer $start, integer $end, integer $limit = 10, integer $offset ) : array
$start integer The start date as a UNIX-timestamp.
$end integer The end date as a UNIX-timestamp.
$limit integer The number of items to get.
$offset integer The offset.
return array

getAllForDateRangeCount() public static method

Get the number of items in a date range
public static getAllForDateRangeCount ( integer $start, integer $end ) : integer
$start integer The start date as a UNIX-timestamp.
$end integer The end date as a UNIX-timestamp.
return integer

getArchiveNumbers() public static method

Get the statistics for the archive
public static getArchiveNumbers ( ) : array
return array

getComments() public static method

Get the comments for an item
public static getComments ( integer $id ) : array
$id integer The ID of the item to get the comments for.
return array

getForTags() public static method

Fetch the list of tags for a list of items
public static getForTags ( array $ids ) : array
$ids array The ids of the items to grab.
return array

getIdForTags() public static method

Selects the proper part of the full URL to get the item's id from the database.
public static getIdForTags ( Url $url ) : integer
$url Frontend\Core\Engine\Url The current URL.
return integer

getNavigation() public static method

Get an array with the previous and the next post
public static getNavigation ( integer $id ) : array
$id integer The id of the current item.
return array

getRecentComments() public static method

Get recent comments
public static getRecentComments ( integer $limit = 5 ) : array
$limit integer The number of comments to get.
return array

getRelated() public static method

Get related items based on tags
public static getRelated ( integer $id, integer $limit = 5 ) : array
$id integer The id of the item to get related items for.
$limit integer The maximum number of items to retrieve.
return array

getRevision() public static method

Get a revision for an item
public static getRevision ( string $url, integer $revision ) : array
$url string The URL for the item to get.
$revision integer The revisionID.
return array

insertComment() public static method

Inserts a new comment
public static insertComment ( array $comment ) : integer
$comment array The comment to add.
return integer

isModerated() public static method

Get moderation status for an author
public static isModerated ( string $author, string $email ) : boolean
$author string The name for the author.
$email string The email address for the author.
return boolean

notifyAdmin() public static method

Notify the admin
public static notifyAdmin ( array $comment )
$comment array The comment that was submitted.