PHP Класс WeDevs\ORM\Eloquent\Database

Наследование: implements Illuminate\Database\ConnectionInterface
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$db
$transactionCount integer Count of active transactions

Открытые методы

Метод Описание
__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.

Приватные методы

Метод Описание
bind_params ( $query, $bindings, $update = false ) : mixed A hacky way to emulate bind parameters into SQL query

Описание методов

__construct() публичный Метод

[__construct description]
public __construct ( )

affectingStatement() публичный Метод

Run an SQL statement and get the number of rows affected.
public affectingStatement ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Результат integer

beginTransaction() публичный Метод

Start a new database transaction.
public beginTransaction ( ) : void
Результат void

bind_and_run() публичный Метод

Bind and run the query
public bind_and_run ( string $query, array $bindings = [] ) : array
$query string
$bindings array
Результат array

commit() публичный Метод

Commit the active database transaction.
public commit ( ) : void
Результат void

delete() публичный Метод

Run a delete statement against the database.
public delete ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Результат integer

getPdo() публичный Метод

Return self as PDO
public getPdo ( ) : Database
Результат Database

getPostProcessor() публичный Метод

public getPostProcessor ( )

getQueryGrammar() публичный Метод

public getQueryGrammar ( )

insert() публичный Метод

Run an insert statement against the database.
public insert ( string $query, array $bindings = [] ) : boolean
$query string
$bindings array
Результат boolean

instance() публичный статический Метод

Initializes the Database class
public static instance ( ) : Database
Результат Database

lastInsertId() публичный Метод

Return the last insert id
public lastInsertId ( string $args ) : integer
$args string
Результат integer

prepareBindings() публичный Метод

Prepare the query bindings for execution.
public prepareBindings ( array $bindings ) : array
$bindings array
Результат array

pretend() публичный Метод

Execute the given callback in "dry run" mode.
public pretend ( Closure $callback ) : array
$callback Closure
Результат array

raw() публичный Метод

Get a new raw query expression.
public raw ( mixed $value ) : Illuminate\Database\Query\Expression
$value mixed
Результат Illuminate\Database\Query\Expression

rollBack() публичный Метод

Rollback the active database transaction.
public rollBack ( ) : void
Результат void

select() публичный Метод

Run a select statement against the database.
public select ( string $query, array $bindings = [] ) : array
$query string
$bindings array
Результат array

selectOne() публичный Метод

Run a select statement and return a single result.
public selectOne ( string $query, array $bindings = [] ) : mixed
$query string
$bindings array
Результат mixed

statement() публичный Метод

Execute an SQL statement and return the boolean result.
public statement ( string $query, array $bindings = [] ) : boolean
$query string
$bindings array
Результат boolean

table() публичный Метод

Begin a fluent query against a database table.
public table ( string $table ) : Builder
$table string
Результат Illuminate\Database\Query\Builder

transaction() публичный Метод

Execute a Closure within a transaction.
public transaction ( Closure $callback ) : mixed
$callback Closure
Результат mixed

transactionLevel() публичный Метод

Get the number of active transactions.
public transactionLevel ( ) : integer
Результат integer

unprepared() публичный Метод

Run a raw, unprepared query against the PDO connection.
public unprepared ( string $query ) : boolean
$query string
Результат boolean

update() публичный Метод

Run an update statement against the database.
public update ( string $query, array $bindings = [] ) : integer
$query string
$bindings array
Результат integer

Описание свойств

$db публичное свойство

public $db

$transactionCount публичное свойство

Count of active transactions
public int $transactionCount
Результат integer