PHP Class WeDevs\ORM\Eloquent\Database

Inheritance: implements Illuminate\Database\ConnectionInterface
Mostra file Open project: tareq1988/wp-eloquent Class Usage Examples

Public Properties

Property Type Description
$db
$transactionCount integer Count of active transactions

Public Methods

Method 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

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

Method Details

__construct() public method

[__construct description]
public __construct ( )

affectingStatement() public method

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

beginTransaction() public method

Start a new database transaction.
public beginTransaction ( ) : void
return void

bind_and_run() public method

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

commit() public method

Commit the active database transaction.
public commit ( ) : void
return void

delete() public method

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

getPdo() public method

Return self as PDO
public getPdo ( ) : Database
return Database

getPostProcessor() public method

public getPostProcessor ( )

getQueryGrammar() public method

public getQueryGrammar ( )

insert() public method

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

instance() public static method

Initializes the Database class
public static instance ( ) : Database
return Database

lastInsertId() public method

Return the last insert id
public lastInsertId ( string $args ) : integer
$args string
return integer

prepareBindings() public method

Prepare the query bindings for execution.
public prepareBindings ( array $bindings ) : array
$bindings array
return array

pretend() public method

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

raw() public method

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

rollBack() public method

Rollback the active database transaction.
public rollBack ( ) : void
return void

select() public method

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

selectOne() public method

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

statement() public method

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

table() public method

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

transaction() public method

Execute a Closure within a transaction.
public transaction ( Closure $callback ) : mixed
$callback Closure
return mixed

transactionLevel() public method

Get the number of active transactions.
public transactionLevel ( ) : integer
return integer

unprepared() public method

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

update() public method

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

Property Details

$db public_oe property

public $db

$transactionCount public_oe property

Count of active transactions
public int $transactionCount
return integer