====== PostModel ======
**Layer:** ''Model'' · **Source:** ''lib/model/PostModel.php:21'' (lines 21–390)
----
class PostModel extends BaseModel
======= Docblock Metadata =======
^ Tag ^ Value ^
| ''@category'' | Model class |
| ''@author'' | M.Noermoehammad |
| ''@license'' | MIT |
| ''@version'' | 1.0 |
======= Inheritance =======
^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:core:basemodel|''BaseModel'']] | parent class/interface |
======= Constants (0) =======
//None.//
======= Properties (1) =======
^ Visibility ^ Type ^ Name ^ Default ^ Line ^
| ''private'' | ''(untyped)'' | ''$linkPosts'' | | 29 |
======= Methods (10) =======
^ Visibility ^ Method ^ Summary ^ Line ^
| public | ''getPostFeeds()'' | getPostFeeds | 40 |
| public | ''getLatestPosts()'' | getLatesetPosts | 74 |
| public | ''getAllBlogPosts()'' | getAllBlogPosts | 115 |
| public | ''getPostById()'' | getPostById | 166 |
| public | ''getPostBySlug()'' | getPostBySlug | 196 |
| public | ''getPostByAuthor()'' | getPostByAuthor | 234 |
| public | ''getRandomHeadlines()'' | getRandomHeadlinesPosts | 272 |
| public | ''getRelatedPosts()'' | getRelatedPosts | 306 |
| public | ''getRandomPosts()'' | getRandomPosts | 331 |
| public | ''getPostsOnSidebar()'' | getPostsOnSidebar | 369 |
======== getPostFeeds() ========
public function getPostFeeds($limit)
//lines 40–61 (22)//
getPostFeeds
Retrieve posts records for sharing post on post feeds
^ Parameter ^ Type ^ Default ^ Description ^
| ''$limit'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — void
======== getLatestPosts() ========
public function getLatestPosts($limit)
//lines 74–106 (33)//
getLatesetPosts
retrieves latest posts and display it on homepage
^ Parameter ^ Type ^ Default ^ Description ^
| ''$limit'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — mixed
======== getAllBlogPosts() ========
public function getAllBlogPosts($sanitize, Paginator $perPage)
//lines 115–154 (40)//
getAllBlogPosts
^ Parameter ^ Type ^ Default ^ Description ^
| ''$sanitize'' | ''(untyped)'' | //required// | //none// |
| ''$perPage'' | [[scriptlog:lib:core:paginator|''Paginator'']] | //required// | //none// |
**Returns:** ''(none declared)'' — void
======== getPostById() ========
public function getPostById($id)
//lines 166–185 (20)//
getPostById
retrieving detail post record by Id
^ Parameter ^ Type ^ Default ^ Description ^
| ''$id'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — boolean|array|object|mixed
======== getPostBySlug() ========
public function getPostBySlug($slug, $fetchMode = null)
//lines 196–223 (28)//
getPostBySlug
retrieving post record by slug
^ Parameter ^ Type ^ Default ^ Description ^
| ''$slug'' | ''(untyped)'' | //required// | //none// |
| ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// |
**Returns:** ''(none declared)'' — mixed
======== getPostByAuthor() ========
public function getPostByAuthor($author)
//lines 234–259 (26)//
getPostByAuthor
retrieving post records based on author
^ Parameter ^ Type ^ Default ^ Description ^
| ''$author'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — mixed
======== getRandomHeadlines() ========
public function getRandomHeadlines()
//lines 272–295 (24)//
getRandomHeadlinesPosts
retrieving random headlines
//Takes no parameters.//
**Returns:** ''(none declared)'' — mixed
======== getRelatedPosts() ========
public function getRelatedPosts($post_title)
//lines 306–320 (15)//
getRelatedPosts
retrieving related post records
^ Parameter ^ Type ^ Default ^ Description ^
| ''$post_title'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — mixed
======== getRandomPosts() ========
public function getRandomPosts($start, $end)
//lines 331–359 (29)//
getRandomPosts
retrieving random posts and display it on homepage
^ Parameter ^ Type ^ Default ^ Description ^
| ''$start'' | ''(untyped)'' | //required// | //none// |
| ''$end'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — mixed
======== getPostsOnSidebar() ========
public function getPostsOnSidebar($limit)
//lines 369–389 (21)//
getPostsOnSidebar
^ Parameter ^ Type ^ Default ^ Description ^
| ''$limit'' | ''(untyped)'' | //required// | //none// |
**Returns:** ''(none declared)'' — array
======= Imports =======
^ Alias ^ Fully-qualified name ^
| ''BaseModel'' | [[scriptlog:lib:core:basemodel|''Scriptlog\Core\BaseModel'']] |
| ''Paginator'' | [[scriptlog:lib:core:paginator|''Scriptlog\Core\Paginator'']] |
| ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] |
----
//This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//