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

Class: Templating_TemplateType

Source Location: /templating_classes/templatetype.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_TemplateType __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 addTemplateType [line 85]

int addTemplateType( array $sqlData)

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



Tags:

return:  Template type id
throws:  Templating_TemplateTypeException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method deleteTemplateType [line 164]

int deleteTemplateType( int $id)

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



Tags:

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


Parameters:

int   $id   Template type id

[ Top ]

method selectTemplateType [line 203]

array selectTemplateType( int $id)

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



Tags:

throws:  Templating_TemplateTypeException
access:  public


Parameters:

int   $id   Template type id

[ Top ]

method selectTemplateTypes [line 261]

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

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

List of supported params:

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




Tags:

throws:  Templating_TemplateTypeException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method templateTypeBelongsToCurrentProject [line 331]

bool templateTypeBelongsToCurrentProject( int $type)

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



Tags:

throws:  Templating_TemplateTypeException
access:  public


Parameters:

int   $type   Template type id

[ Top ]

method templateTypeBelongsToCurrentUser [line 377]

bool templateTypeBelongsToCurrentUser( int $template_type)

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



Tags:

throws:  Templating_TemplateTypeException
access:  public


Parameters:

int   $template_type   Template type id

[ Top ]

method testForUniqueName [line 414]

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

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

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




Tags:

throws:  Templating_TemplateTypeException
access:  public


Parameters:

string   $name   Template type name
int   $id   Template type id

[ Top ]

method updateTemplateType [line 121]

int updateTemplateType( int $id, array $sqlData)

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



Tags:

return:  Affected rows
throws:  Templating_TemplateTypeException
access:  public


Parameters:

int   $id   Template type id
array   $sqlData   Row data

[ Top ]


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