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

Class: Templating_GlobalTemplate

Source Location: /templating_classes/globaltemplate.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 51]

Reference to base class



Tags:

access:  public

Type:   object


[ Top ]



Class Methods


constructor __construct [line 58]

Templating_GlobalTemplate __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 addGlobalTemplate [line 84]

int addGlobalTemplate( array $sqlData)

Creates new global template. Takes field=>value array with global template data as first argument. Returns insert id.



Tags:

return:  Global template id
throws:  Templating_GlobalTemplateException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countGlobalTemplates [line 447]

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

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

List of supported params:

  • n/a




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteGlobalTemplate [line 163]

int deleteGlobalTemplate( int $id)

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



Tags:

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


Parameters:

int   $id   Global template id

[ Top ]

method globalTemplateBelongsToCurrentProject [line 496]

bool globalTemplateBelongsToCurrentProject( int $template)

Checks whether the given global template belongs to the current project or not.

Takes the id of the global template as first argument. Returns bool.




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

int   $template   Global template id

[ Top ]

method globalTemplateBelongsToCurrentUser [line 542]

bool globalTemplateBelongsToCurrentUser( int $global_template)

Tests whether global template belongs to current user or not. Takes the global template id as first argument. Returns bool.



Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

int   $global_template   Global template id

[ Top ]

method selectGlobalTemplate [line 202]

array selectGlobalTemplate( int $id)

Selects one global template. Takes the global template id as first argument. Returns array with global template information.



Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

int   $id   Global template id

[ Top ]

method selectGlobalTemplates [line 264]

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

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

List of supported params:

  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method smartyFetchGlobalTemplate [line 338]

array smartyFetchGlobalTemplate( string $name)

Fetches global template from database for usage in the smarty resource plugin.

Takes the global template name as first argument. Returns array.




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

string   $name   Name

[ Top ]

method smartyFetchGlobalTemplateTimestamp [line 394]

int smartyFetchGlobalTemplateTimestamp( string $name)

Fetches last modification date of global template from database for usage in the smarty resource plugin. Takes the global template name as first argument.

Returns UNIX timestamp.




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

string   $name   Name

[ Top ]

method testForUniqueName [line 579]

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

Tests given global template name for uniqueness. Takes the global template name as first argument and an optional global template id as second argument.

If the global template id is given, this global template won't be considered when checking for uniqueness (useful for updates). Returns boolean true if global template name is unique.




Tags:

throws:  Templating_GlobalTemplateException
access:  public


Parameters:

string   $name   Global template name
int   $id   Global template id

[ Top ]

method updateGlobalTemplate [line 120]

int updateGlobalTemplate( int $id, array $sqlData)

Updates global template. Takes the global template id as first argument, a field=>value array with the new global template data as second argument. Returns amount of affected rows.



Tags:

return:  Affected rows
throws:  Templating_GlobalTemplateException
access:  public


Parameters:

int   $id   Global template id
array   $sqlData   Row data

[ Top ]


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