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

Class: Templating_TemplateSet

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

Templating_TemplateSet __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 addTemplateSet [line 85]

int addTemplateSet( array $sqlData)

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



Tags:

return:  Template set id
throws:  Templating_TemplateSetException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method deleteTemplateSet [line 167]

int deleteTemplateSet( int $id)

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



Tags:

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


Parameters:

int   $id   Template set id

[ Top ]

method selectTemplateSet [line 206]

array selectTemplateSet( int $id)

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



Tags:

throws:  Templating_TemplateSetException
access:  public


Parameters:

int   $id   Template set id

[ Top ]

method selectTemplateSets [line 263]

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

Method to select one or more template sets. 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_TemplateSetException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method templateSetBelongsToCurrentProject [line 332]

bool templateSetBelongsToCurrentProject( int $set)

Checks whether the given template set belongs to the current project or not. Takes the id of the template set as first argument. Returns bool.



Tags:

throws:  Templating_TemplateSetException
access:  public


Parameters:

int   $set   Template set id

[ Top ]

method templateSetBelongsToCurrentUser [line 378]

bool templateSetBelongsToCurrentUser( int $template_set)

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



Tags:

throws:  Templating_TemplateSetException
access:  public


Parameters:

int   $template_set   Template set id

[ Top ]

method testForUniqueName [line 416]

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

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

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




Tags:

throws:  Templating_TemplateSetException
access:  public


Parameters:

string   $name   Template set name
int   $id   Template set id

[ Top ]

method updateTemplateSet [line 124]

int updateTemplateSet( int $id, array $sqlData)

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



Tags:

return:  Affected rows
throws:  Templating_TemplateSetException
access:  public


Parameters:

int   $id   Template set id
array   $sqlData   Row data

[ Top ]


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