PHP Class Ouzo\Db

Afficher le fichier Open project: letsdrink/ouzo Class Usage Examples

Méthodes publiques

Свойство Type Description
$_dbHandle PDO
$_startedTransaction

Méthodes publiques

Méthode 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

Méthode Description
_buildDsn ( $params )
_createPdo ( $params )

Method Details

__construct() public méthode

public __construct ( $loadDefault = true )

beginTransaction() public méthode

public beginTransaction ( )

callFunction() public static méthode

public static callFunction ( $functionName, $parameters )

commitTransaction() public méthode

public commitTransaction ( )

connectDb() public méthode

public connectDb ( $params = [] )

disableTransactions() public méthode

public disableTransactions ( )

enableTransactions() public méthode

public enableTransactions ( )

execute() public méthode

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

getInstance() public static méthode

public static getInstance ( )

isConnected() public méthode

public isConnected ( )

lastErrorMessage() public méthode

public lastErrorMessage ( )

lastInsertId() public méthode

public lastInsertId ( $sequence )

query() public méthode

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

rollbackTransaction() public méthode

public rollbackTransaction ( )

runInTransaction() public méthode

public runInTransaction ( $callable )

transactional() public static méthode

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

Property Details

$_dbHandle public_oe property

public PDO $_dbHandle
Résultat PDO

$_startedTransaction public_oe property

public $_startedTransaction