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

Class: Content_EventPosting

Source Location: /content_classes/eventposting.class.php

Class Overview




Variables

Methods



Class Details

[line 36]


[ Top ]


Class Variables

static $instance =  null

[line 43]

Singleton



Tags:

access:  public

Type:   object


[ Top ]

$base =  null

[line 50]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 57]

Content_EventPosting __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 addEventPosting [line 83]

int addEventPosting( array $sqlData)

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



Tags:

return:  Insert id
throws:  Content_EventPostingException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countEventPostings [line 604]

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

Method to count event 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_EventPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method deleteEventPosting [line 158]

int deleteEventPosting( int $id)

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



Tags:

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


Parameters:

int   $id   Event posting id

[ Top ]

method eventPostingBelongsToCurrentProject [line 1219]

int eventPostingBelongsToCurrentProject( int $event_posting)

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



Tags:

return:  bool
throws:  Content_EventPostingException
access:  public


Parameters:

int   $event_posting   Event posting id

[ Top ]

method eventPostingBelongsToCurrentUser [line 1269]

bool eventPostingBelongsToCurrentUser( int $event_posting)

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



Tags:

throws:  Content_EventPostingException
access:  public


Parameters:

int   $event_posting   Event posting id

[ Top ]

method eventPostingExists [line 1165]

bool eventPostingExists( int $id)

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



Tags:

throws:  Content_EventPostingException
access:  public


Parameters:

int   $id   Event posting id

[ Top ]

method resolveEventPosting [line 1097]

int resolveEventPosting( )

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

The function either expects the plain event 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 event posting




Tags:

throws:  Content_EventPostingException
access:  public


[ Top ]

method selectDifferentDays [line 975]

array selectDifferentDays( array $params)

Selects days with event 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 event postings assigned to this page
  • year, int, optional: Return only event postings added in that year
  • month, int, optional: Return only event postings added in that month
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_EventPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectDifferentMonths [line 860]

array selectDifferentMonths( array $params)

Selects months with event 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 event postings assigned to this page
  • year, int, optional: Return only event 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_EventPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method selectDifferentYears [line 753]

array selectDifferentYears( array $params)

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

List of supported params:

  • page, int, optional: Return only event 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_EventPostingException
access:  public


Parameters:

array   $params  

[ Top ]

method selectEventPosting [line 195]

array selectEventPosting( int $id)

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



Tags:

throws:  Content_EventPostingException
access:  public


Parameters:

int   $id   Event posting id

[ Top ]

method selectEventPostings [line 342]

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

Method to select one or more event 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
  • title, string, optional: title.
  • search_name, string, opional: Search string input.
  • order_marco, string, otpional: How to sort the result set. Supported macros:
    • DATE_MODIFIED: sorty by date modified
    • DATE_ADDED: sort by date added
    • RANDOM: sort by random
    • TITLE: sort by title
    • DATE_START: sort by start date




Tags:

throws:  Content_EventPostingException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method updateEventPosting [line 116]

int updateEventPosting( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_EventPostingException
access:  public


Parameters:

int   $id   Event posting id
array   $sqlData   Row data

[ Top ]


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