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

Class: Content_SimpleDate

Source Location: /content_classes/simpledate.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_SimpleDate __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 addSimpleDate [line 85]

int addSimpleDate( array $sqlData)

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



Tags:

return:  Insert id
throws:  Content_SimpleDateException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method checkDateOnEmpty [line 762]

bool checkDateOnEmpty( $dates)

Tests given date array wether the values are not null and in workable format.

Returns boolean true if month, day and year values are in a workable format.




Tags:

access:  public


Parameters:

   $dates  

[ Top ]

method countSimpleDates [line 529]

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

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

List of supported params:

  • page, int, optional: Page id
  • draft, int, optional: Draft bit (0/1)
  • draft, int, optional: Draft bit (0/1)
  • timeframe, string, optional: specific range of rows to return




Tags:

throws:  Content_SimpleDateException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method deleteSimpleDate [line 160]

int deleteSimpleDate( int $id)

Removes simple date from the simple dates table. Takes the simple date id as first argument. Returns amount of affected rows.



Tags:

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


Parameters:

int   $id   Simple Date id

[ Top ]

method selectSimpleDate [line 197]

array selectSimpleDate( int $id)

Selects one simple date. Takes the simple date id as first argument. Returns array with simple date information.



Tags:

throws:  Content_SimpleDateException
access:  public


Parameters:

int   $id   Simple Date id

[ Top ]

method selectSimpleDates [line 331]

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

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

List of supported params:

  • page, int, optional: Page id
  • draft, int, optional: Draft bit (0/1)
  • current_date, string, optional: return rows based on current date (FORWARD/BACKWARD)
  • 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. Supported macros:
    • DATE_MODIFIED: sorty by date modified
    • DATE_ADDED: sort by date added
    • DATE_START: sort by start date
    • DATE_END: sort by end date
    • RANDOM: sort by random




Tags:

throws:  Content_SimpleDateException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method simpleDateBelongsToCurrentProject [line 679]

int simpleDateBelongsToCurrentProject( int $simple_date)

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



Tags:

return:  bool
throws:  Content_SimpleDateException
access:  public


Parameters:

int   $simple_date   Simple Date id

[ Top ]

method simpleDateBelongsToCurrentUser [line 729]

bool simpleDateBelongsToCurrentUser( int $simple_date)

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



Tags:

throws:  Content_SimpleDateException
access:  public


Parameters:

int   $simple_date   Simple Date id

[ Top ]

method simpleDateExists [line 625]

bool simpleDateExists( int $id)

Tests if simple date exists. Takes the id of the simple date as first argument. Returns bool.



Tags:

throws:  Content_SimpleDateException
access:  public


Parameters:

int   $id   Simple Date id

[ Top ]

method updateSimpleDate [line 118]

int updateSimpleDate( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_SimpleDateException
access:  public


Parameters:

int   $id   Simple Date id
array   $sqlData   Row data

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:52:00 +0100 by phpDocumentor 1.4.3