PHP Class Ouzo\Db

Exibir arquivo Open project: letsdrink/ouzo Class Usage Examples

Public Properties

Property Type Description
$_dbHandle PDO
$_startedTransaction

Public Methods

Method Description
__construct ( $loadDefault = true )
beginTransaction ( )
callFunction ( $functionName, $parameters )
commitTransaction ( )
connectDb ( $params = [] )
disableTransactions ( )
enableTransactions ( )
execute ( string $query, array $params = [], array $options = [] ) : integer Returns number of affected rows
getInstance ( )
isConnected ( )
lastErrorMessage ( )
lastInsertId ( $sequence )
query ( $query, $params = [], $options = [] )
rollbackTransaction ( )
runInTransaction ( $callable )
transactional ( mixed $object ) : TransactionalProxy Returns a new transactional proxy for given target object/function.

Private Methods

Method Description
_buildDsn ( $params )
_createPdo ( $params )

Method Details

__construct() public method

public __construct ( $loadDefault = true )

beginTransaction() public method

public beginTransaction ( )

callFunction() public static method

public static callFunction ( $functionName, $parameters )

commitTransaction() public method

public commitTransaction ( )

connectDb() public method

public connectDb ( $params = [] )

disableTransactions() public method

public disableTransactions ( )

enableTransactions() public method

public enableTransactions ( )

execute() public method

Returns number of affected rows
public execute ( string $query, array $params = [], array $options = [] ) : integer
$query string
$params array
$options array
return integer

getInstance() public static method

public static getInstance ( )

isConnected() public method

public isConnected ( )

lastErrorMessage() public method

public lastErrorMessage ( )

lastInsertId() public method

public lastInsertId ( $sequence )

query() public method

public query ( $query, $params = [], $options = [] )

rollbackTransaction() public method

public rollbackTransaction ( )

runInTransaction() public method

public runInTransaction ( $callable )

transactional() public static method

All methods called on proxy are run in a transaction.
public static transactional ( mixed $object ) : TransactionalProxy
$object mixed
return Ouzo\Db\TransactionalProxy

Property Details

$_dbHandle public_oe property

public PDO $_dbHandle
return PDO

$_startedTransaction public_oe property

public $_startedTransaction