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

Class: Content_StructuralTemplate

Source Location: /content_classes/structuraltemplate.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_StructuralTemplate __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 addStructuralTemplate [line 86]

int addStructuralTemplate( array $sqlData)

Adds structural template to the structural template table. Takes a field=>value array with structural template data as first argument.

Returns insert id.




Tags:

return:  Structural template id
throws:  Content_StructuralTemplateException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countStructuralTemplates [line 367]

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

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

List of supported params:

  • none




Tags:

throws:  Content_StructuralTemplateException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteStructuralTemplate [line 165]

int deleteStructuralTemplate( int $id)

Removes structural template from the structural template table.

Takes the structural template id as first argument. Returns amount of affected rows.




Tags:

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


Parameters:

int   $id   Structural template id

[ Top ]

method selectStructuralTemplate [line 204]

array selectStructuralTemplate( int $id)

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



Tags:

throws:  Content_StructuralTemplateException
access:  public


Parameters:

int   $id   Structural template id

[ Top ]

method selectStructuralTemplates [line 272]

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

Method to select one or more structural templates. 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
    • 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_StructuralTemplateException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method structuralTemplateBelongsToCurrentProject [line 478]

int structuralTemplateBelongsToCurrentProject( int $structural_template)

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



Tags:

return:  bool
throws:  Content_StructuralTemplateException
access:  public


Parameters:

int   $structural_template   Structural structural template id

[ Top ]

method structuralTemplateBelongsToCurrentUser [line 524]

bool structuralTemplateBelongsToCurrentUser( int $structural_template)

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



Tags:

throws:  Content_StructuralTemplateException
access:  public


Parameters:

int   $structural_template   template id

[ Top ]

method testForUniqueName [line 420]

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

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

Returns boolean true if structural template name is unique.




Tags:

throws:  Content_StructuralTemplateException
access:  public


Parameters:

string   $name   Structural template name
int   $id   Structural template id

[ Top ]

method updateStructuralTemplate [line 122]

int updateStructuralTemplate( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_StructuralTemplateException
access:  public


Parameters:

int   $id   Structural template id
array   $sqlData   Row data

[ Top ]


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