Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Application\Database Class Reference

Elgg 2.0 public database API. More...

Inheritance diagram for Elgg\Application\Database:
Elgg\Database

Public Member Functions

 __construct (ElggDb $db)
 Constructor. More...
 
 getData ($query, $callback= '', array $params=[])
 {} More...
 
 getDataRow ($query, $callback= '', array $params=[])
 {} More...
 
 insertData ($query, array $params=[])
 {} More...
 
 updateData ($query, $getNumRows=false, array $params=[])
 {} More...
 
 deleteData ($query, array $params=[])
 {} More...
 
 getTablePrefix ()
 {} More...
 
 sanitizeInt ($value, $signed=true)
 {} More...
 
 sanitizeString ($value)
 {} More...
 
 fingerprintCallback ($callback)
 {} More...
 
 setTimer (Timer $timer)
 {} More...
 
 setLogger (Logger $logger)
 {} More...
 
 setupConnections ()
 {} More...
 
 connect ($type="readwrite")
 {} More...
 
 runSqlScript ($scriptlocation)
 {} More...
 
 registerDelayedQuery ($query, $type, $handler="", array $params=[])
 {} More...
 
 executeDelayedQueries ()
 {} More...
 
 enableQueryCache ()
 {} More...
 
 disableQueryCache ()
 {} More...
 
 assertInstalled ()
 {} More...
 
 getQueryCount ()
 {} More...
 
 getServerVersion ($type)
 {} More...
 
- Public Member Functions inherited from Elgg\Database
 __construct (\Elgg\Database\Config $config,\Elgg\Logger $logger=null)
 Constructor. More...
 
 setLogger (Logger $logger)
 Set the logger object. More...
 
 setupConnections ()
 Establish database connections. More...
 
 connect ($type="readwrite")
 Establish a connection to the database server. More...
 
 getData ($query, $callback=null, array $params=[])
 Retrieve rows from the database. More...
 
 getDataRow ($query, $callback=null, array $params=[])
 Retrieve a single row from the database. More...
 
 insertData ($query, array $params=[])
 Insert a row into the database. More...
 
 updateData ($query, $get_num_rows=false, array $params=[])
 Update the database. More...
 
 deleteData ($query, array $params=[])
 Delete data from the database. More...
 
 fingerprintCallback ($callback)
 Get a string that uniquely identifies a callback during the current request. More...
 
 runSqlScript ($scriptlocation)
 Runs a full database script from disk. More...
 
 registerDelayedQuery ($query, $type, $callback=null, array $params=[])
 Queue a query for execution upon shutdown. More...
 
 executeDelayedQueries ()
 Trigger all queries that were registered as "delayed" queries. More...
 
 enableQueryCache ()
 Enable the query cache. More...
 
 disableQueryCache ()
 Disable the query cache. More...
 
 assertInstalled ()
 Test that the Elgg database is installed. More...
 
 getQueryCount ()
 Get the number of queries made to the database. More...
 
 getTablePrefix ()
 Get the prefix for Elgg's tables. More...
 
 sanitizeInt ($value, $signed=true)
 Sanitizes an integer value for use in a query. More...
 
 sanitizeString ($value)
 Sanitizes a string for use in a query. More...
 
 getServerVersion ($type)
 Get the server version number. More...
 

Additional Inherited Members

- Public Attributes inherited from Elgg\Database
global $USERNAME_TO_GUID_MAP_CACHE
 
 $USERNAME_TO_GUID_MAP_CACHE = array()
 
const DELAYED_QUERY = 'q'
 
const DELAYED_TYPE = 't'
 
const DELAYED_HANDLER = 'h'
 
const DELAYED_PARAMS = 'p'
 
- Protected Member Functions inherited from Elgg\Database
 getConnection ($type)
 Gets (if required, also creates) a DB connection. More...
 
 getResults ($query, $callback=null, $single=false, array $params=[])
 Handles queries that return results, running the results through a an optional callback function. More...
 
 executeQuery ($query, Connection $connection, array $params=[])
 Execute a query. More...
 
 invalidateQueryCache ()
 Invalidate the query cache. More...
 

Detailed Description

Elgg 2.0 public database API.

This is returned by elgg()->getDb() or Application::start()->getDb(), but is only a 2.0 compatibility wrapper for the real Elgg.

See Also
::getDb for more details.

Definition at line 20 of file Database.php.

Constructor & Destructor Documentation

Elgg\Application\Database::__construct ( ElggDb  $db)

Constructor.

Parameters
ElggDb$dbThe Elgg database private

Definition at line 35 of file Database.php.

Member Function Documentation

Elgg\Application\Database::assertInstalled ( )

{}

Definition at line 200 of file Database.php.

Elgg\Application\Database::connect (   $type = "readwrite")

{}

Definition at line 140 of file Database.php.

Elgg\Application\Database::deleteData (   $query,
array  $params = [] 
)

{}

Definition at line 70 of file Database.php.

Elgg\Application\Database::disableQueryCache ( )

{}

Definition at line 190 of file Database.php.

Elgg\Application\Database::enableQueryCache ( )

{}

Definition at line 180 of file Database.php.

Elgg\Application\Database::executeDelayedQueries ( )

{}

Definition at line 170 of file Database.php.

Elgg\Application\Database::fingerprintCallback (   $callback)

{}

Definition at line 100 of file Database.php.

Elgg\Application\Database::getData (   $query,
  $callback = '',
array  $params = [] 
)

{}

Definition at line 42 of file Database.php.

Elgg\Application\Database::getDataRow (   $query,
  $callback = '',
array  $params = [] 
)

{}

Definition at line 49 of file Database.php.

Elgg\Application\Database::getQueryCount ( )

{}

Definition at line 210 of file Database.php.

Elgg\Application\Database::getServerVersion (   $type)

{}

Definition at line 220 of file Database.php.

Elgg\Application\Database::getTablePrefix ( )

{}

Definition at line 77 of file Database.php.

Elgg\Application\Database::insertData (   $query,
array  $params = [] 
)

{}

Definition at line 56 of file Database.php.

Elgg\Application\Database::registerDelayedQuery (   $query,
  $type,
  $handler = "",
array  $params = [] 
)

{}

Definition at line 160 of file Database.php.

Elgg\Application\Database::runSqlScript (   $scriptlocation)

{}

Definition at line 150 of file Database.php.

Elgg\Application\Database::sanitizeInt (   $value,
  $signed = true 
)

{}

Definition at line 84 of file Database.php.

Elgg\Application\Database::sanitizeString (   $value)

{}

Definition at line 91 of file Database.php.

Elgg\Application\Database::setLogger ( Logger  $logger)

{}

Definition at line 120 of file Database.php.

Elgg\Application\Database::setTimer ( Timer  $timer)

{}

Definition at line 110 of file Database.php.

Elgg\Application\Database::setupConnections ( )

{}

Definition at line 130 of file Database.php.

Elgg\Application\Database::updateData (   $query,
  $getNumRows = false,
array  $params = [] 
)

{}

Definition at line 63 of file Database.php.


The documentation for this class was generated from the following file: