JDWordpress  v.2014-02-11
Wordpress Plugin for CakePHP
JDBlogPost Class Reference

This file represents the interface to posts. More...

Inheritance diagram for JDBlogPost:

Public Member Functions

 getAllPosts ($addedConditions=[], $limit=-1)
 Retrieves and processes all posts using $optionsStandard; if given $addedConditions and/or $limit, then those apply as well. More...
 
 getAllPostsAsArchives ($addedConditions=[], $limit=-1)
 Retrieves and processes all posts using $optionsStandard; if given $addedConditions and/or $limit, then those apply as well. More...
 
 getAllPostsForTaxonomyByTerm ($type= 'category')
 Retrieves a list of all posts for the given $taxonomy broken down into groups by $term. More...
 
 getAuthorPosts ($author, $limit=-1)
 Retrieves summaries for the author slug $author. More...
 
 getAuthorPostsAsArchives ($author, $limit=-1)
 Retrieves summaries for the author slug $author. More...
 
 getNamedPost ($postName)
 Retrieves and processes the post by its slug. More...
 
 getNameForTaxonomySlug ($slug)
 Returns the name field given a slug. More...
 
 getRandomPosts ($limit=1)
 Retrieves and processes a random post. More...
 
 getRandomPostsAsArchives ($limit=1)
 Retrieves and processes a random post. More...
 
 getRecentPosts ($limit=5)
 Retrieves and processes recent posts. More...
 
 getRecentPostsAsArchives ($limit=5)
 Retrieves and processes recent posts. More...
 
 getTaxonomyPosts ($term= 'uncategorized', $type= 'category', $limit=-1)
 Retrieves posts for the taxonomy $term and $type; for example can retrieve all posts that have "category" of "news" or all posts with "post_tag" of "cool". More...
 
 getTaxonomyPostsAsArchives ($term= 'uncategorized', $type= 'category', $limit=-1)
 Retrieves posts for the taxonomy $term and $type. More...
 
 getTermsForTaxonomy ($type= 'category')
 Retrieves a list of all terms for the given taxonomy. More...
 
 prepareSQLDump ()
 Outputs the SQL database to a file and returns a reference to the filename so that it may be downloaded.
 

Data Fields

 $belongsTo
 CakePHP standard. More...
 
 $displayField = 'post_name'
 CakePHP standard.
 
 $order
 CakePHP standard. More...
 
 $primaryKey = 'ID'
 CakePHP standard.
 
 $useDbConfig = 'JDWordpressDB'
 CakePHP standard.
 
 $useTable = 'posts'
 CakePHP standard.
 

Detailed Description

This file represents the interface to posts.

Member Function Documentation

getNamedPost (   $postName)

Retrieves and processes the post by its slug.

Parameters
string$postNameThe slug to retrieve.
Returns
array Structure with the post content and details.
getAllPosts (   $addedConditions = [ ],
  $limit = -1 
)

Retrieves and processes all posts using $optionsStandard; if given $addedConditions and/or $limit, then those apply as well.

Parameters
array$addedConditionsCakePHP conditions array to add.
string$limitNumber of posts to return.
Returns
array Structure with the posts content and details.
getAllPostsAsArchives (   $addedConditions = [ ],
  $limit = -1 
)

Retrieves and processes all posts using $optionsStandard; if given $addedConditions and/or $limit, then those apply as well.

Parameters
array$addedConditionsCakePHP conditions array to add.
string$limitNumber of posts to return.
Returns
array Structure with the posts content and details.
getRecentPosts (   $limit = 5)

Retrieves and processes recent posts.

Parameters
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getRecentPostsAsArchives (   $limit = 5)

Retrieves and processes recent posts.

Parameters
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getRandomPosts (   $limit = 1)

Retrieves and processes a random post.

Parameters
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getRandomPostsAsArchives (   $limit = 1)

Retrieves and processes a random post.

Parameters
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getAuthorPosts (   $author,
  $limit = -1 
)

Retrieves summaries for the author slug $author.

Parameters
string$authorAuthor slug.
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getAuthorPostsAsArchives (   $author,
  $limit = -1 
)

Retrieves summaries for the author slug $author.

Parameters
string$authorAuthor slug.
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getTaxonomyPosts (   $term = 'uncategorized',
  $type = 'category',
  $limit = -1 
)

Retrieves posts for the taxonomy $term and $type; for example can retrieve all posts that have "category" of "news" or all posts with "post_tag" of "cool".

Parameters
string$termTaxonomy term.
string$typeTaxonomy type.
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getTaxonomyPostsAsArchives (   $term = 'uncategorized',
  $type = 'category',
  $limit = -1 
)

Retrieves posts for the taxonomy $term and $type.

For example can retrieve all posts that have "category" of "news" or all posts with "post_tag" of "cool".

Parameters
string$termTaxonomy term.
string$typeTaxonomy type.
integer$limitNumber of posts to retrieve.
Returns
array Structure with the posts content and details.
getAllPostsForTaxonomyByTerm (   $type = 'category')

Retrieves a list of all posts for the given $taxonomy broken down into groups by $term.

Parameters
string$typeTaxonomy type.
Returns
array Structure with the posts content and details.
getTermsForTaxonomy (   $type = 'category')

Retrieves a list of all terms for the given taxonomy.

Parameters
string$typeTaxonomy type.
Returns
array Structure with the posts content and details.
getNameForTaxonomySlug (   $slug)

Returns the name field given a slug.

Parameters
string$slug
Returns
string Indicating the name field for the slug.

Field Documentation

$order
Initial value:
=
[
'post_date_gmt' => 'DESC'

CakePHP standard.

$belongsTo
Initial value:
=
[
'JDBlogAuthor' =>
[
'className' => 'JDWordpress.JDBlogAuthor'

CakePHP standard.


The documentation for this class was generated from the following file: