Documentation

Db
in package

Db Class

Database connection handler

Tags
copyright

Cloudrexx AG

author

Michael Ritter michael.ritter@comvation.com

subpackage

core_db

Table of Contents

Properties

$adodb  : ADONewConnection
AdoDB instance
$cacheDriver  : CacheProvider
doctrine cache driver instance
$db  : mixed
$dbUser  : mixed
$em  : EntityManager
Doctrine entity manager instance
$loggableListener  : LoggableListener
Doctrine LoggableListener instance
$metaDataCacheDriver  : CacheProvider
doctrine meta data cache driver instance
$pdo  : PDO
PDO instance
$translationListener  : TranslationListener

Methods

__construct()  : mixed
Creates a new instance of the database connection handler
addSchemaFileDirectories()  : mixed
Adds YAML directories to entity manager
cxAdodbPdoConnectionFactory()  : CustomAdodbPdo
Factory callback for AdoDB NewConnection
getAdoDb()  : ADONewConnection
Returns the AdoDB connection
getDb()  : Db
Returns the database info object
getEntityManager()  : EntityManager
Returns the doctrine entity manager
getLoggableListener()  : LoggableListener
Returns the LoggableListener in use
getPdoConnection()  : PDO
Initializes the PDO connection
getTranslationListener()  : TranslationListener
Return the TranslationListener
setAdoDb()  : mixed
Sets the AdoDB connection
setEntityManager()  : mixed
Bind initialized Entity Manager
setPdoConnection()  : mixed
Bind initialized PDO connection
setUsername()  : mixed
Sets the username for loggable listener

Properties

$adodb

AdoDB instance

protected ADONewConnection $adodb = null

$cacheDriver

doctrine cache driver instance

protected CacheProvider $cacheDriver

$em

Doctrine entity manager instance

protected EntityManager $em = null

$loggableListener

Doctrine LoggableListener instance

protected LoggableListener $loggableListener = null

$metaDataCacheDriver

doctrine meta data cache driver instance

protected CacheProvider $metaDataCacheDriver

$pdo

PDO instance

protected PDO $pdo = null

$translationListener

protected TranslationListener $translationListener = null

Methods

__construct()

Creates a new instance of the database connection handler

public __construct(Db $db, DbUser $dbUser, Cx $cx) : mixed
Parameters
$db : Db

Database connection details

$dbUser : DbUser

Database user details

$cx : Cx

Cx instance to create this instance for. This will be used to fetch the usercache (ComponentController) for the query, result und meta-data caching of the doctrine ORM.

addSchemaFileDirectories()

Adds YAML directories to entity manager

public addSchemaFileDirectories(array<string|int, mixed> $paths) : mixed
Parameters
$paths : array<string|int, mixed>

List of paths

getAdoDb()

Returns the AdoDB connection

public getAdoDb() : ADONewConnection

Use Doctrine (getEntityManager()) instead

Tags
global

string $ADODB_FETCH_MODE

Return values
ADONewConnection

getDb()

Returns the database info object

public getDb() : Db
Return values
Db

Database info object

getEntityManager()

Returns the doctrine entity manager

public getEntityManager() : EntityManager
Return values
EntityManager

getLoggableListener()

Returns the LoggableListener in use

public getLoggableListener() : LoggableListener
Return values
LoggableListener

Current loggable listener

getPdoConnection()

Initializes the PDO connection

public getPdoConnection() : PDO
Return values
PDO

PDO connection

getTranslationListener()

Return the TranslationListener

public getTranslationListener() : TranslationListener
Tags
author

Reto Kohli reto.kohli@comvation.com

Return values
TranslationListener

setAdoDb()

Sets the AdoDB connection

public setAdoDb(ADONewConnection $adoDb) : mixed
Parameters
$adoDb : ADONewConnection

Initialized AdoDB connection to be used for legacy database queries.

setEntityManager()

Bind initialized Entity Manager

public setEntityManager(EntityManager $em) : mixed
Parameters
$em : EntityManager

Initialized Entity Manager to be used by doctrine.

setPdoConnection()

Bind initialized PDO connection

public setPdoConnection(PDO $pdo) : mixed
Parameters
$pdo : PDO

Initialized PDO connection to be used as database connection.

setUsername()

Sets the username for loggable listener

public setUsername(string $username) : mixed

This is currently being called by User::login().

Parameters
$username : string

Username data as string


        
On this page

Search results