PHP Class Phergie_Plugin_Lart, phergie

Author: Phergie Development Team ([email protected])
Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$db PDO PDO instance for the database
$delete PDOStatement Prepared statement for deleting the definition for a given term
$process PDOStatement Prepared statement for searching for a definition for which the term matches as a regular expression against a given search string
$save PDOStatement Prepared statement for inserting a new definition
$select PDOStatement Prepared statement for searching for a definition by its exact term

Public Methods

Method Description
onAction ( ) : void Processes definition triggers in CTCP actions.
onCommandAddlart ( string $term, string $definition ) : void Creates a new definition.
onCommandDeletelart ( string $term ) : void Removes an existing definition.
onCommandLartinfo ( string $term ) : void Returns information about a definition.
onLoad ( ) : void Checks for dependencies and initializes the database.
onPrivmsg ( ) : void Processes definition triggers in messages.

Protected Methods

Method Description
deleteLart ( string $term ) : boolean Deletes a given definition.
getLart ( string $term ) : mixed Retrieves the definition for a given term if it exists.
processLart ( ) : void Processes definition triggers in the text of the current event.
saveLart ( string $term, string $definition ) : boolean Saves a given definition.

Method Details

deleteLart() protected method

Deletes a given definition.
protected deleteLart ( string $term ) : boolean
$term string Term for which the definition should be deleted
return boolean TRUE if the definition was found and deleted, FALSE otherwise

getLart() protected method

Retrieves the definition for a given term if it exists.
protected getLart ( string $term ) : mixed
$term string Term to search for
return mixed String containing the definition or FALSE if no definition exists

onAction() public method

Processes definition triggers in CTCP actions.
public onAction ( ) : void
return void

onCommandAddlart() public method

Creates a new definition.
public onCommandAddlart ( string $term, string $definition ) : void
$term string Term to add
$definition string Definition to add
return void

onCommandDeletelart() public method

Removes an existing definition.
public onCommandDeletelart ( string $term ) : void
$term string Term for which the definition should be removed
return void

onCommandLartinfo() public method

Returns information about a definition.
public onCommandLartinfo ( string $term ) : void
$term string Term about which to return information
return void

onLoad() public method

Checks for dependencies and initializes the database.
public onLoad ( ) : void
return void

onPrivmsg() public method

Processes definition triggers in messages.
public onPrivmsg ( ) : void
return void

processLart() protected method

Processes definition triggers in the text of the current event.
protected processLart ( ) : void
return void

saveLart() protected method

Saves a given definition.
protected saveLart ( string $term, string $definition ) : boolean
$term string Term to trigger a response containing the corresponding definition, may be a regular expression
$definition string Definition corresponding to the term
return boolean TRUE if the definition was saved successfully, FALSE otherwise

Property Details

$db protected property

PDO instance for the database
protected PDO $db
return PDO

$delete protected property

Prepared statement for deleting the definition for a given term
protected PDOStatement $delete
return PDOStatement

$process protected property

Prepared statement for searching for a definition for which the term matches as a regular expression against a given search string
protected PDOStatement $process
return PDOStatement

$save protected property

Prepared statement for inserting a new definition
protected PDOStatement $save
return PDOStatement

$select protected property

Prepared statement for searching for a definition by its exact term
protected PDOStatement $select
return PDOStatement