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

Class: Application_TextMacro

Source Location: /application_classes/textmacro.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]

Application_TextMacro __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 addTextMacro [line 85]

int addTextMacro( array $sqlData)

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



Tags:

return:  Insert id
throws:  Application_TextMacroException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method applyTextMacros [line 475]

string applyTextMacros( int $text, [string $stage = "pre"])

Applies text macro to the given text. Takes the text macro id as first argument, the string with the text to convert as second argument. Returns converted string.



Tags:

return:  Converted text
throws:  Application_TextMacroException
access:  public


Parameters:

int   $text   Text macro id
string   $stage   Text to convert

[ Top ]

method countTextMacros [line 361]

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

Method to count the existing text macros. Takes key=>value array with count params as first argument. Returns array.

List of supported params:

No params supported.




Tags:

throws:  Application_TextMacroException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteTextMacro [line 165]

int deleteTextMacro( int $id)

Removes text macro from the text macros table. Takes the text macro id as first argument. Returns amount of affected rows.



Tags:

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


Parameters:

int   $id   Text macro id

[ Top ]

method selectTextMacro [line 203]

array selectTextMacro( int $id)

Selects one text macro. Takes the text macro id as first argument. Returns array with text macro information.



Tags:

throws:  Application_TextMacroException
access:  public


Parameters:

int   $id   Text macro id

[ Top ]

method selectTextMacros [line 264]

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

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

List of supported params:

  • type, string, optional: text macro type (pre, post, startup, shutdown)
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Application_TextMacroException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueName [line 415]

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

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

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




Tags:

throws:  Application_TextMacroException
access:  public


Parameters:

string   $name   Text macro name
int   $id   Text macro id

[ Top ]

method textMacroBelongsToCurrentProject [line 601]

int textMacroBelongsToCurrentProject( int $text_macro)

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



Tags:

return:  bool
throws:  Application_TextMacroException
access:  public


Parameters:

int   $text_macro   Text macro id

[ Top ]

method textMacroBelongsToCurrentUser [line 647]

bool textMacroBelongsToCurrentUser( int $text_macro)

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



Tags:

throws:  Application_TextMacroException
access:  public


Parameters:

int   $text_macro   Text macro id

[ Top ]

method updateTextMacro [line 122]

int updateTextMacro( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Application_TextMacroException
access:  public


Parameters:

int   $id   Text macro id
array   $sqlData   Row data

[ Top ]


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