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

Class: Content_Abbreviation

Source Location: /content_classes/abbreviation.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_Abbreviation __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 abbreviationBelongsToCurrentProject [line 546]

int abbreviationBelongsToCurrentProject( int $abbreviation)

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



Tags:

return:  bool
throws:  Content_AbbreviationException
access:  public


Parameters:

int   $abbreviation   Abbreviation id

[ Top ]

method abbreviationBelongsToCurrentUser [line 592]

bool abbreviationBelongsToCurrentUser( int $abbreviation)

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



Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

int   $abbreviation   Abbreviation id

[ Top ]

method addAbbreviation [line 85]

int addAbbreviation( array $sqlData)

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



Tags:

return:  Abbreviation id
throws:  Content_AbbreviationException
access:  public


Parameters:

array   $sqlData   Row data

[ Top ]

method countAbbreviations [line 387]

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

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

List of supported params:

  • none




Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

array   $params   Count params

[ Top ]

method deleteAbbreviation [line 163]

int deleteAbbreviation( int $id)

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



Tags:

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


Parameters:

int   $id   Abbreviation id

[ Top ]

method getAbbreviation [line 436]

string getAbbreviation( [array $args = array()])

Builds abbreviation internal syntax. Takes key=>value array with count params as first argument. Returns string.



Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

array   $args   Abbreviation args

[ Top ]

method selectAbbreviation [line 201]

array selectAbbreviation( int $id)

Selects one abbreviation. Takes the abbreviation id as first argument.

Returns array with abbreviation information.




Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

int   $id   Abbreviation id

[ Top ]

method selectAbbreviations [line 277]

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

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

List of supported params:

  • order_marco, string, optional: How to sort the result set. Supported macros:
    • NAME: sort by name
    • LONG_FORM: sort by long_form
    • GLOSSARY_FORM: sort by glossar_form
    • DATE_MODIFIED: sort by date modified
    • DATE_ADDED: sort by date added
  • long_form, string, optional: compare the occurence of long_form content
  • start, int, optional: row offset
  • limit, int, optional: amount of rows to return




Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

array   $params   Select params

[ Top ]

method testForUniqueLongForm [line 488]

bool testForUniqueLongForm( string $long_form, [int $id = null])

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

Returns boolean true if abbreviation long_form is unique.




Tags:

throws:  Content_AbbreviationException
access:  public


Parameters:

string   $long_form   Abbreviation long_form
int   $id   Abbreviation id

[ Top ]

method updateAbbreviation [line 121]

int updateAbbreviation( int $id, array $sqlData)

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

Returns amount of affected rows.




Tags:

return:  Affected rows
throws:  Content_AbbreviationException
access:  public


Parameters:

int   $id   Abbreviation id
array   $sqlData   Row data

[ Top ]


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