Property | Type | Description | |
---|---|---|---|
$db | resource | SQLite object | |
$fetchFixedKarma | PDOStatement | Retrieves an existing fixed karma record | |
$fetchKarma | PDOStatement | Retrieves an existing karma record | |
$fetchNegativeAnswer | PDOStatement | Retrieves a negative answer for a karma comparison | |
$fetchPositiveAnswer | PDOStatement | Retrieves a positive answer for a karma comparison | |
$insertKarma | PDOStatement | Prepared statement to add a new karma record | |
$updateKarma | PDOStatement | Prepared statement to update an existing karma record |
Method | Description | |
---|---|---|
getDb ( ) : PDO | Returns a connection to the plugin database, initializing one if none is explicitly set. | |
onCommandKarma ( string $term ) : void | Get the karma rating for a given term. | |
onCommandReincarnate ( string $term ) : void | Resets the karma for a term to 0. | |
onLoad ( ) : void | Check for dependencies and initializes a database connection and prepared statements. | |
onPrivmsg ( ) : void | Intercepts a message and processes any contained recognized commands. | |
setDb ( PDO $db ) : Phergie_Plugin_Karma | Sets the connection to the plugin database, mainly intended for unit testing. |
Method | Description | |
---|---|---|
compareKarma ( string $term0, string $term1, string $method ) : void | Compares the karma between two terms. Optionally increases/decreases the karma of either term. | |
fetchFixedKarma ( string $term ) : string | Returns a phrase describing the karma rating for a specified term for which the karma rating is fixed. | |
fetchKarma ( string $term ) : integer | boolean | Returns the karma rating for a specified term for which the karma rating can be modified. | |
getCanonicalTerm ( string $term ) : string | Get the canonical form of a given term. | |
initializePreparedStatements ( ) : void | Initializes prepared statements used by the plugin. | |
modifyKarma ( string $term, string $action ) : integer | Modifes a term's karma. |
protected fetchFixedKarma ( string $term ) : string | ||
$term | string | Term for which to fetch the corresponding karma rating |
return | string | Phrase describing the karma rating, which may be append to the term to form a complete response |
protected getCanonicalTerm ( string $term ) : string | ||
$term | string | Term for which a canonical form is required |
return | string | Canonical term |
public getDb ( ) : PDO | ||
return | PDO | Database connection |
protected initializePreparedStatements ( ) : void | ||
return | void |
public onCommandKarma ( string $term ) : void | ||
$term | string | Term for which the karma rating needs to be retrieved |
return | void |
public onCommandReincarnate ( string $term ) : void | ||
$term | string | Term for which to reset the karma rating |
return | void |
public setDb ( PDO $db ) : Phergie_Plugin_Karma | ||
$db | PDO | Database connection |
return | Phergie_Plugin_Karma | Provides a fluent interface |
protected PDOStatement $fetchFixedKarma | ||
return | PDOStatement |
protected PDOStatement $fetchKarma | ||
return | PDOStatement |
protected PDOStatement $fetchNegativeAnswer | ||
return | PDOStatement |
protected PDOStatement $fetchPositiveAnswer | ||
return | PDOStatement |
protected PDOStatement $insertKarma | ||
return | PDOStatement |