Welcompose
[ class tree: Welcompose ] [ index: Welcompose ] [ all elements ]

Class: Content_BlogPosting

Source Location: /content_classes/blogposting.class.php

Class Overview




Variables

Methods



Class Details

[line 38]


[ Top ]


Class Variables

static $instance =  null

[line 45]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 52]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 59]

Content_BlogPosting __construct( )

Start instance of base class, load configuration and establish database connection. Please don't call the constructor direcly, use the singleton pattern instead.



Tags:

access:  public


[ Top ]

method addBlogPosting [line 85]

int addBlogPosting( array $sqlData)

Adds blog posting to the blog posting table. Takes a field=>value array with blog posting data as first argument. Returns insert id.



Tags:

return:  Insert id
throws:  Content_BlogPostingException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method blogPostingBelongsToCurrentProject [line 1274]

int blogPostingBelongsToCurrentProject( int $blog_posting)

Tests whether given blog posting belongs to current project. Takes the blog posting id as first argument. Returns bool.



Tags:

return:  bool
throws:  Content_BlogPostingException
access:  public


Parameters:

int   $blog_posting   Blog posting id

[ Top ]

method blogPostingBelongsToCurrentUser [line 1324]

bool blogPostingBelongsToCurrentUser( int $blog_posting)

Test whether blog posting belongs to current user or not. Takes the blog posting id as first argument. Returns bool.



Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

int   $blog_posting   Blog posting id

[ Top ]

method blogPostingExists [line 1220]

bool blogPostingExists( int $id)

Tests if blog posting exists. Takes the id of the blog posting as first argument. Returns bool.



Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

int   $id   Blog posting id

[ Top ]

method countBlogPostings [line 655]

int countBlogPostings( [array $params = array()])

Method to count blog postings. Takes key=>value array with select params as first argument. Returns int.

List of supported params:

  • user, int, optional: User/author id
  • page, int, optional: Page id
  • draft, int, optional: Draft bit (0/1)
  • current_date, string, optional: return rows based on current date (FORWARD/BACKWARD)
  • tag_word_url, string, optional: Tag word
  • timeframe, string, optional: specific range of rows to return
  • year_added, string, optional: four digit year number
  • month_added, string, optional: two digit month number
  • day_added, string, optional: two digit day number




Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method deleteBlogPosting [line 160]

int deleteBlogPosting( int $id)

Removes blog posting from the blog postings table. Takes the blog posting id as first argument. Returns amount of affected rows.



Tags:

return:  Amount of affected rows
throws:  Content_BlogPostingException
access:  public


Parameters:

int   $id   Blog posting id

[ Top ]

method resolveBlogPosting [line 1152]

int resolveBlogPosting( )

Resolves blog posting using the available url params. Returns the blog posting id on success or throws an exception on failure.

The function either expects the plain blog posting id (~ $_REQUEST['posting']) or a combination consisting of the following parameters:

  • year: Four digit year number when the posting was added
  • month: Two digit month number when the posting was added
  • day: Two digit day number when the posting was added
  • title: Url title of the blog posting




Tags:

throws:  Content_BlogPostingException
access:  public


[ Top ]

method selectBlogPosting [line 197]

array selectBlogPosting( int $id)

Selects one blog posting. Takes the blog posting id as first argument. Returns array with blog posting information.



Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

int   $id   Blog posting id

[ Top ]

method selectBlogPostings [line 371]

array selectBlogPostings( [array $params = array()])

Method to select one or more blog postings. Takes key=>value array with select params as first argument. Returns array.

List of supported params:

  • user, int, optional: User/author id
  • page, int, optional: Page id
  • draft, int, optional: Draft bit (0/1)
  • year_added, string, optional: four digit year number
  • month_added, string, optional: two digit month number
  • day_added, string, optional: two digit day number
  • current_date, string, optional: return rows based on current date (FORWARD/BACKWARD)
  • tag_word_url, string, optional: Tag word
  • timeframe, string, optional: specific range of rows to return
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return
  • order_marco, string, otpional: How to sort the result set.
  • title, string, optional: title.
  • search_name, string, opional: Search string input. Supported macros:
    • DATE_MODIFIED: sorty by date modified
    • DATE_ADDED: sort by date added
    • RANDOM: sort by random
    • TITLE: sort by title




Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectDifferentDays [line 1030]

array selectDifferentDays( array $params)

Selects days with blog postings. Takes field=>key array with select params as first argument. Returns array with days, months and years.

List of supported params:

  • page, int, optional: Return only blog postings assigned to this page
  • year, int, optional: Return only blog postings added in that year
  • month, int, optional: Return only blog postings added in that month
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectDifferentMonths [line 915]

array selectDifferentMonths( array $params)

Selects months with blog postings. Takes field=>key array with select params as first argument. Returns array with months and years.

List of supported params:

  • page, int, optional: Return only blog postings assigned to this page
  • year, int, optional: Return only blog postings added in that year
  • order_macro, string, optional: Sorting instructions
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectDifferentYears [line 808]

array selectDifferentYears( array $params)

Selects years with blog postings. Takes field=>key array with select params as first argument. Returns array with years.

List of supported params:

  • page, int, optional: Return only blog postings assigned to this page
  • order_macro, string, optional: Sorting instructions
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_BlogPostingException
access:  public


Parameters:

array   $params  

[ Top ]

method updateBlogPosting [line 118]

int updateBlogPosting( int $id, array $sqlData)

Updates blog posting. Takes the blog posting id as first argument, a field=>value array with the new blog posting data as second argument.

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_BlogPostingException
access:  public


Parameters:

int   $id   Blog posting id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:42 +0100 by phpDocumentor 1.4.3