PHP Class Newscoop\Doctrine\AdoDbAdapter

Mostrar archivo Open project: sourcefabric/newscoop

Protected Properties

Property Type Description
$affectedRows integer
$connection Doctrine\DBAL\Connection
$statement Newscoop\Doctrine\AdoDbStatement

Public Methods

Method Description
__construct ( Doctrine\DBAL\Connection $connection )
affected_rows ( ) : integer Get affected rows count
createDatabase ( string $database ) : void Create a new database
errorMsg ( ) : string Fetch extended error information associated with the last database operation.
escape ( mixed $value ) : string Escape value
escapeIdentifier ( string $identifier ) : string Escape identifier
escapeKeyVal ( string $key, string $val ) : string Escape column equals value statement
escapeOperation ( array $operation ) : string Escape comparison operation
execute ( string $sql, $params = [] ) : null Execute sql statement
executeUpdate ( string $sql ) : integer Execute INSERT/UPDATE/DELETE statement and return number of affected rows
getAll ( string $sql, array $params = [] ) : array Execute sql query and return the result as an array
getCol ( string $sql, array $params = [] ) : array Execute sql query and returns all elements of the first column.
getDriverName ( ) : string Get driver name
getOne ( string $sql, array $params = [] ) : mixed Execute sql query and returns the value of first column of the first row.
getRow ( string $sql, array $params = [] ) : array Execute sql query and return first row of the result as an associative array.
hasDatabase ( string $database ) : boolean Test if there is a database with given name
hasTable ( string $table ) : boolean Test if there is a table with given name
insert_id ( ) : integer Get last insert id
isConnected ( boolean $forceConnection = false ) : boolean Test if is connected
selectLimit ( string $sql, integer $limit, integer $offset ) : mixed Performs select with given limit and offset params

Method Details

__construct() public method

public __construct ( Doctrine\DBAL\Connection $connection )
$connection Doctrine\DBAL\Connection

affected_rows() public method

Get affected rows count
public affected_rows ( ) : integer
return integer

createDatabase() public method

Create a new database
public createDatabase ( string $database ) : void
$database string
return void

errorMsg() public method

Fetch extended error information associated with the last database operation.
public errorMsg ( ) : string
return string

escape() public method

Escape value
public escape ( mixed $value ) : string
$value mixed
return string

escapeIdentifier() public method

Escape identifier
public escapeIdentifier ( string $identifier ) : string
$identifier string
return string

escapeKeyVal() public method

Escape column equals value statement
public escapeKeyVal ( string $key, string $val ) : string
$key string
$val string
return string

escapeOperation() public method

Escape comparison operation
public escapeOperation ( array $operation ) : string
$operation array
return string

execute() public method

Execute sql statement
public execute ( string $sql, $params = [] ) : null
$sql string
return null

executeUpdate() public method

Execute INSERT/UPDATE/DELETE statement and return number of affected rows
public executeUpdate ( string $sql ) : integer
$sql string
return integer

getAll() public method

Execute sql query and return the result as an array
public getAll ( string $sql, array $params = [] ) : array
$sql string
$params array
return array

getCol() public method

Execute sql query and returns all elements of the first column.
public getCol ( string $sql, array $params = [] ) : array
$sql string
$params array
return array

getDriverName() public method

Get driver name
public getDriverName ( ) : string
return string

getOne() public method

Execute sql query and returns the value of first column of the first row.
public getOne ( string $sql, array $params = [] ) : mixed
$sql string
$params array
return mixed

getRow() public method

Execute sql query and return first row of the result as an associative array.
public getRow ( string $sql, array $params = [] ) : array
$sql string
$params array
return array

hasDatabase() public method

Test if there is a database with given name
public hasDatabase ( string $database ) : boolean
$database string
return boolean

hasTable() public method

Test if there is a table with given name
public hasTable ( string $table ) : boolean
$table string
return boolean

insert_id() public method

Get last insert id
public insert_id ( ) : integer
return integer

isConnected() public method

Test if is connected
public isConnected ( boolean $forceConnection = false ) : boolean
$forceConnection boolean
return boolean

selectLimit() public method

Performs select with given limit and offset params
public selectLimit ( string $sql, integer $limit, integer $offset ) : mixed
$sql string
$limit integer
$offset integer
return mixed

Property Details

$affectedRows protected_oe property

protected int $affectedRows
return integer

$connection protected_oe property

protected Connection,Doctrine\DBAL $connection
return Doctrine\DBAL\Connection

$statement protected_oe property

protected Newscoop\Doctrine\AdoDbStatement $statement
return Newscoop\Doctrine\AdoDbStatement