PHP Class WeDevs\ORM\Eloquent\Database

Inheritance: implements Illuminate\Database\ConnectionInterface
Afficher le fichier Open project: tareq1988/wp-eloquent Class Usage Examples

Méthodes publiques

Свойство Type Description
$db
$transactionCount integer Count of active transactions

Méthodes publiques

Méthode Description
__construct ( ) [__construct description]
affectingStatement ( string $query, array $bindings = [] ) : integer Run an SQL statement and get the number of rows affected.
beginTransaction ( ) : void Start a new database transaction.
bind_and_run ( string $query, array $bindings = [] ) : array Bind and run the query
commit ( ) : void Commit the active database transaction.
delete ( string $query, array $bindings = [] ) : integer Run a delete statement against the database.
getPdo ( ) : Database Return self as PDO
getPostProcessor ( )
getQueryGrammar ( )
insert ( string $query, array $bindings = [] ) : boolean Run an insert statement against the database.
instance ( ) : Database Initializes the Database class
lastInsertId ( string $args ) : integer Return the last insert id
prepareBindings ( array $bindings ) : array Prepare the query bindings for execution.
pretend ( Closure $callback ) : array Execute the given callback in "dry run" mode.
raw ( mixed $value ) : Illuminate\Database\Query\Expression Get a new raw query expression.
rollBack ( ) : void Rollback the active database transaction.
select ( string $query, array $bindings = [] ) : array Run a select statement against the database.
selectOne ( string $query, array $bindings = [] ) : mixed Run a select statement and return a single result.
statement ( string $query, array $bindings = [] ) : boolean Execute an SQL statement and return the boolean result.
table ( string $table ) : Builder Begin a fluent query against a database table.
transaction ( Closure $callback ) : mixed Execute a Closure within a transaction.
transactionLevel ( ) : integer Get the number of active transactions.
unprepared ( string $query ) : boolean Run a raw, unprepared query against the PDO connection.
update ( string $query, array $bindings = [] ) : integer Run an update statement against the database.

Private Methods

Méthode Description
bind_params ( $query, $bindings, $update = false ) : mixed A hacky way to emulate bind parameters into SQL query

Method Details

__construct() public méthode

[__construct description]
public __construct ( )

affectingStatement() public méthode

Run an SQL statement and get the number of rows affected.
public affectingStatement ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Résultat integer

beginTransaction() public méthode

Start a new database transaction.
public beginTransaction ( ) : void
Résultat void

bind_and_run() public méthode

Bind and run the query
public bind_and_run ( string $query, array $bindings = [] ) : array
$query string
$bindings array
Résultat array

commit() public méthode

Commit the active database transaction.
public commit ( ) : void
Résultat void

delete() public méthode

Run a delete statement against the database.
public delete ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Résultat integer

getPdo() public méthode

Return self as PDO
public getPdo ( ) : Database
Résultat Database

getPostProcessor() public méthode

public getPostProcessor ( )

getQueryGrammar() public méthode

public getQueryGrammar ( )

insert() public méthode

Run an insert statement against the database.
public insert ( string $query, array $bindings = [] ) : boolean
$query string
$bindings array
Résultat boolean

instance() public static méthode

Initializes the Database class
public static instance ( ) : Database
Résultat Database

lastInsertId() public méthode

Return the last insert id
public lastInsertId ( string $args ) : integer
$args string
Résultat integer

prepareBindings() public méthode

Prepare the query bindings for execution.
public prepareBindings ( array $bindings ) : array
$bindings array
Résultat array

pretend() public méthode

Execute the given callback in "dry run" mode.
public pretend ( Closure $callback ) : array
$callback Closure
Résultat array

raw() public méthode

Get a new raw query expression.
public raw ( mixed $value ) : Illuminate\Database\Query\Expression
$value mixed
Résultat Illuminate\Database\Query\Expression

rollBack() public méthode

Rollback the active database transaction.
public rollBack ( ) : void
Résultat void

select() public méthode

Run a select statement against the database.
public select ( string $query, array $bindings = [] ) : array
$query string
$bindings array
Résultat array

selectOne() public méthode

Run a select statement and return a single result.
public selectOne ( string $query, array $bindings = [] ) : mixed
$query string
$bindings array
Résultat mixed

statement() public méthode

Execute an SQL statement and return the boolean result.
public statement ( string $query, array $bindings = [] ) : boolean
$query string
$bindings array
Résultat boolean

table() public méthode

Begin a fluent query against a database table.
public table ( string $table ) : Builder
$table string
Résultat Illuminate\Database\Query\Builder

transaction() public méthode

Execute a Closure within a transaction.
public transaction ( Closure $callback ) : mixed
$callback Closure
Résultat mixed

transactionLevel() public méthode

Get the number of active transactions.
public transactionLevel ( ) : integer
Résultat integer

unprepared() public méthode

Run a raw, unprepared query against the PDO connection.
public unprepared ( string $query ) : boolean
$query string
Résultat boolean

update() public méthode

Run an update statement against the database.
public update ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Résultat integer

Property Details

$db public_oe property

public $db

$transactionCount public_oe property

Count of active transactions
public int $transactionCount
Résultat integer