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

Class: Content_GlobalBox

Source Location: /content_classes/globalbox.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_GlobalBox __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 addGlobalBox [line 85]

int addGlobalBox( array $sqlData)

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



Tags:

return:  Global box id
throws:  Content_GlobalBoxException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countGlobalBoxes [line 373]

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

Method to count global boxes. Takes key=>value array with count params as first argument. Returns array.

List of supported params:

  • none




Tags:

throws:  Content_GlobalBoxException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteGlobalBox [line 163]

int deleteGlobalBox( int $id)

Removes global box from the global box table. Takes the global box id as first argument. Returns amount of affected rows.



Tags:

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


Parameters:

int   $id   Global box id

[ Top ]

method globalBoxBelongsToCurrentProject [line 484]

int globalBoxBelongsToCurrentProject( int $global_box)

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



Tags:

return:  bool
throws:  Content_GlobalBoxException
access:  public


Parameters:

int   $global_box   Global global box id

[ Top ]

method globalBoxBelongsToCurrentUser [line 530]

bool globalBoxBelongsToCurrentUser( int $global_box)

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



Tags:

throws:  Content_GlobalBoxException
access:  public


Parameters:

int   $global_box   box id

[ Top ]

method selectGlobalBox [line 201]

array selectGlobalBox( int $id)

Selects one global box. Takes the global box id as first argument.

Returns array with global box information.




Tags:

throws:  Content_GlobalBoxException
access:  public


Parameters:

int   $id   Global box id

[ Top ]

method selectGlobalBoxes [line 274]

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

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

List of supported params:

  • order_marco, string, otpional: How to sort the result set. Supported macros:
    • NAME: sort by name
    • PRIORITY: sort by priority
    • RANDOM: sort by random selection
    • DATE_MODIFIED: sort by date modified
    • DATE_ADDED: sort by date added
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_GlobalBoxException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueName [line 426]

bool testForUniqueName( string $name, [int $id = null])

Tests given global box name for uniqueness. Takes the global box name as first argument and an optional global box id as second argument. If the global box id is given, this global box won't be considered when checking for uniqueness (useful for updates).

Returns boolean true if global box name is unique.




Tags:

throws:  Content_GlobalBoxException
access:  public


Parameters:

string   $name   Global box name
int   $id   Global box id

[ Top ]

method updateGlobalBox [line 121]

int updateGlobalBox( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_GlobalBoxException
access:  public


Parameters:

int   $id   Global box id
array   $sqlData   Row data

[ Top ]


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