Свойство | Type | Description | |
---|---|---|---|
$config | array | The database connection configuration options. | |
$database | string | The name of the connected database. | |
$doctrineConnection | Doctrine\DBAL\Connection | The instance of Doctrine connection. | |
$events | Illuminate\Contracts\Events\Dispatcher | The event dispatcher instance. | |
$fetchArgument | mixed | The argument for the fetch mode. | |
$fetchConstructorArgument | array | The constructor arguments for the PDO::FETCH_CLASS fetch mode. | |
$fetchMode | integer | The default fetch mode of the connection. | |
$loggingQueries | boolean | Indicates whether queries are being logged. | |
$pdo | PDO | The active PDO connection. | |
$postProcessor | Illuminate\Database\Query\Processors\Processor | The query post processor implementation. | |
$pretending | boolean | Indicates if the connection is in a "dry run". | |
$queryGrammar | Illuminate\Database\Query\Grammars\Grammar | The query grammar implementation. | |
$queryLog | array | All of the queries run against the connection. | |
$readPdo | PDO | The active PDO connection used for reads. | |
$reconnector | callable | The reconnector instance for the connection. | |
$schemaGrammar | Illuminate\Database\Schema\Grammars\Grammar | The schema grammar implementation. | |
$tablePrefix | string | The table prefix for the connection. | |
$transactions | integer | The number of active transactions. |
Méthode | Description | |
---|---|---|
__construct ( PDO | Closure $pdo, string $database = '', string $tablePrefix = '', array $config = [] ) : void | Create a new database connection instance. | |
affectingStatement ( string $query, array $bindings = [] ) : integer | Run an SQL statement and get the number of rows affected. | |
beginTransaction ( ) : void | Start a new database transaction. | |
bindValues ( PDOStatement $statement, array $bindings ) : void | Bind values to their parameters in the given statement. | |
commit ( ) : void | Commit the active database transaction. | |
cursor ( string $query, array $bindings = [], boolean $useReadPdo = true ) : Generator | Run a select statement against the database and returns a generator. | |
delete ( string $query, array $bindings = [] ) : integer | Run a delete statement against the database. | |
disableQueryLog ( ) : void | Disable the query log on the connection. | |
disconnect ( ) : void | Disconnect from the underlying PDO connection. | |
enableQueryLog ( ) : void | Enable the query log on the connection. | |
flushQueryLog ( ) : void | Clear the query log. | |
getConfig ( string $option ) : mixed | Get an option from the configuration options. | |
getDatabaseName ( ) : string | Get the name of the connected database. | |
getDoctrineColumn ( string $table, string $column ) : Doctrine\DBAL\Schema\Column | Get a Doctrine Schema Column instance. | |
getDoctrineConnection ( ) : Doctrine\DBAL\Connection | Get the Doctrine DBAL database connection instance. | |
getDoctrineSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager | Get the Doctrine DBAL schema manager for the connection. | |
getDriverName ( ) : string | Get the PDO driver name. | |
getEventDispatcher ( ) : Illuminate\Contracts\Events\Dispatcher | Get the event dispatcher used by the connection. | |
getFetchArgument ( ) : mixed | Get the fetch argument to be applied when selecting. | |
getFetchConstructorArgument ( ) : array | Get custom constructor arguments for the PDO::FETCH_CLASS fetch mode. | |
getFetchMode ( ) : integer | Get the default fetch mode for the connection. | |
getName ( ) : string | null | Get the database connection name. | |
getPdo ( ) : PDO | Get the current PDO connection. | |
getPostProcessor ( ) : Illuminate\Database\Query\Processors\Processor | Get the query post processor used by the connection. | |
getQueryGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar | Get the query grammar used by the connection. | |
getQueryLog ( ) : array | Get the connection query log. | |
getReadPdo ( ) : PDO | Get the current PDO connection used for reading. | |
getSchemaBuilder ( ) : Illuminate\Database\Schema\Builder | Get a schema builder instance for the connection. | |
getSchemaGrammar ( ) : Illuminate\Database\Schema\Grammars\Grammar | Get the schema grammar used by the connection. | |
getTablePrefix ( ) : string | Get the table prefix for the connection. | |
insert ( string $query, array $bindings = [] ) : boolean | Run an insert statement against the database. | |
isDoctrineAvailable ( ) : boolean | Is Doctrine available? | |
listen ( Closure $callback ) : void | Register a database query listener with the connection. | |
logQuery ( string $query, array $bindings, float | null $time = null ) : void | Log a query in the connection's query log. | |
logging ( ) : boolean | Determine whether we're logging queries. | |
prepareBindings ( array $bindings ) : array | Prepare the query bindings for execution. | |
pretend ( Closure $callback ) : array | Execute the given callback in "dry run" mode. | |
pretending ( ) : boolean | Determine if the connection in a "dry run". | |
query ( ) : |
Get a new query builder instance. | |
raw ( mixed $value ) : Illuminate\Database\Query\Expression | Get a new raw query expression. | |
reconnect ( ) : void | Reconnect to the database. | |
rollBack ( integer | null $toLevel = null ) : void | Rollback the active database transaction. | |
select ( string $query, array $bindings = [], boolean $useReadPdo = true ) : array | Run a select statement against the database. | |
selectFromWriteConnection ( string $query, array $bindings = [] ) : array | Run a select statement against the database. | |
selectOne ( string $query, array $bindings = [] ) : mixed | null | Run a select statement and return a single result. | |
setDatabaseName ( string $database ) : string | Set the name of the connected database. | |
setEventDispatcher ( Illuminate\Contracts\Events\Dispatcher $events ) : void | Set the event dispatcher instance on the connection. | |
setFetchMode ( integer $fetchMode, mixed $fetchArgument = null, array $fetchConstructorArgument = [] ) : integer | Set the default fetch mode for the connection, and optional arguments for the given fetch mode. | |
setPdo ( PDO | null $pdo ) | Set the PDO connection. | |
setPostProcessor ( Illuminate\Database\Query\Processors\Processor $processor ) : void | Set the query post processor used by the connection. | |
setQueryGrammar ( Illuminate\Database\Query\Grammars\Grammar $grammar ) : void | Set the query grammar used by the connection. | |
setReadPdo ( PDO | null $pdo ) | Set the PDO connection used for reading. | |
setReconnector ( callable $reconnector ) | Set the reconnect instance on the connection. | |
setSchemaGrammar ( Illuminate\Database\Schema\Grammars\Grammar $grammar ) : void | Set the schema grammar used by the connection. | |
setTablePrefix ( string $prefix ) : void | Set the table prefix in use by the connection. | |
statement ( string $query, array $bindings = [] ) : boolean | Execute an SQL statement and return the boolean result. | |
table ( string $table ) : |
Begin a fluent query against a database table. | |
transaction ( Closure $callback, integer $attempts = 1 ) : 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. | |
useDefaultPostProcessor ( ) : void | Set the query post processor to the default implementation. | |
useDefaultQueryGrammar ( ) : void | Set the query grammar to the default implementation. | |
useDefaultSchemaGrammar ( ) : void | Set the schema grammar to the default implementation. | |
withTablePrefix ( Illuminate\Database\Grammar $grammar ) : Illuminate\Database\Grammar | Set the table prefix and return the grammar. |
Méthode | Description | |
---|---|---|
fireConnectionEvent ( string $event ) : void | Fire an event for this connection. | |
getDefaultPostProcessor ( ) : Illuminate\Database\Query\Processors\Processor | Get the default post processor instance. | |
getDefaultQueryGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar | Get the default query grammar instance. | |
getDefaultSchemaGrammar ( ) : Illuminate\Database\Schema\Grammars\Grammar | Get the default schema grammar instance. | |
getElapsedTime ( integer $start ) : float | Get the elapsed time since a given starting point. | |
getPdoForSelect ( boolean $useReadPdo = true ) : PDO | Get the PDO connection to use for a select query. | |
reconnectIfMissingConnection ( ) : void | Reconnect to the database if a PDO connection is missing. | |
run ( string $query, array $bindings, Closure $callback ) : mixed | Run a SQL statement and log its execution context. | |
runQueryCallback ( string $query, array $bindings, Closure $callback ) : mixed | Run a SQL statement. | |
tryAgainIfCausedByLostConnection ( Illuminate\Database\QueryException $e, string $query, array $bindings, Closure $callback ) : mixed | Handle a query exception that occurred during query execution. |
public beginTransaction ( ) : void | ||
Résultat | void |
public bindValues ( PDOStatement $statement, array $bindings ) : void | ||
$statement | PDOStatement | |
$bindings | array | |
Résultat | void |
public disableQueryLog ( ) : void | ||
Résultat | void |
public disconnect ( ) : void | ||
Résultat | void |
public enableQueryLog ( ) : void | ||
Résultat | void |
protected fireConnectionEvent ( string $event ) : void | ||
$event | string | |
Résultat | void |
public getDatabaseName ( ) : string | ||
Résultat | string |
protected getDefaultPostProcessor ( ) : Illuminate\Database\Query\Processors\Processor | ||
Résultat | Illuminate\Database\Query\Processors\Processor |
protected getDefaultQueryGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar | ||
Résultat | Illuminate\Database\Query\Grammars\Grammar |
protected getDefaultSchemaGrammar ( ) : Illuminate\Database\Schema\Grammars\Grammar | ||
Résultat | Illuminate\Database\Schema\Grammars\Grammar |
public getDoctrineColumn ( string $table, string $column ) : Doctrine\DBAL\Schema\Column | ||
$table | string | |
$column | string | |
Résultat | Doctrine\DBAL\Schema\Column |
public getDoctrineConnection ( ) : Doctrine\DBAL\Connection | ||
Résultat | Doctrine\DBAL\Connection |
public getDoctrineSchemaManager ( ) : Doctrine\DBAL\Schema\AbstractSchemaManager | ||
Résultat | Doctrine\DBAL\Schema\AbstractSchemaManager |
public getDriverName ( ) : string | ||
Résultat | string |
protected getElapsedTime ( integer $start ) : float | ||
$start | integer | |
Résultat | float |
public getEventDispatcher ( ) : Illuminate\Contracts\Events\Dispatcher | ||
Résultat | Illuminate\Contracts\Events\Dispatcher |
public getFetchArgument ( ) : mixed | ||
Résultat | mixed |
public getFetchConstructorArgument ( ) : array | ||
Résultat | array |
public getFetchMode ( ) : integer | ||
Résultat | integer |
protected getPdoForSelect ( boolean $useReadPdo = true ) : PDO | ||
$useReadPdo | boolean | |
Résultat | PDO |
public getPostProcessor ( ) : Illuminate\Database\Query\Processors\Processor | ||
Résultat | Illuminate\Database\Query\Processors\Processor |
public getQueryGrammar ( ) : Illuminate\Database\Query\Grammars\Grammar | ||
Résultat | Illuminate\Database\Query\Grammars\Grammar |
public getQueryLog ( ) : array | ||
Résultat | array |
public getReadPdo ( ) : PDO | ||
Résultat | PDO |
public getSchemaBuilder ( ) : Illuminate\Database\Schema\Builder | ||
Résultat | Illuminate\Database\Schema\Builder |
public getSchemaGrammar ( ) : Illuminate\Database\Schema\Grammars\Grammar | ||
Résultat | Illuminate\Database\Schema\Grammars\Grammar |
public getTablePrefix ( ) : string | ||
Résultat | string |
public isDoctrineAvailable ( ) : boolean | ||
Résultat | boolean |
public prepareBindings ( array $bindings ) : array | ||
$bindings | array | |
Résultat | array |
public pretending ( ) : boolean | ||
Résultat | boolean |
public query ( ) : |
||
Résultat |
protected reconnectIfMissingConnection ( ) : void | ||
Résultat | void |
public setDatabaseName ( string $database ) : string | ||
$database | string | |
Résultat | string |
public setEventDispatcher ( Illuminate\Contracts\Events\Dispatcher $events ) : void | ||
$events | Illuminate\Contracts\Events\Dispatcher | |
Résultat | void |
public setPostProcessor ( Illuminate\Database\Query\Processors\Processor $processor ) : void | ||
$processor | Illuminate\Database\Query\Processors\Processor | |
Résultat | void |
public setQueryGrammar ( Illuminate\Database\Query\Grammars\Grammar $grammar ) : void | ||
$grammar | Illuminate\Database\Query\Grammars\Grammar | |
Résultat | void |
public setReadPdo ( PDO | null $pdo ) | ||
$pdo | PDO | null |
public setReconnector ( callable $reconnector ) | ||
$reconnector | callable |
public setSchemaGrammar ( Illuminate\Database\Schema\Grammars\Grammar $grammar ) : void | ||
$grammar | Illuminate\Database\Schema\Grammars\Grammar | |
Résultat | void |
public setTablePrefix ( string $prefix ) : void | ||
$prefix | string | |
Résultat | void |
public transactionLevel ( ) : integer | ||
Résultat | integer |
public unprepared ( string $query ) : boolean | ||
$query | string | |
Résultat | boolean |
public useDefaultPostProcessor ( ) : void | ||
Résultat | void |
public useDefaultQueryGrammar ( ) : void | ||
Résultat | void |
public useDefaultSchemaGrammar ( ) : void | ||
Résultat | void |
public withTablePrefix ( Illuminate\Database\Grammar $grammar ) : Illuminate\Database\Grammar | ||
$grammar | Illuminate\Database\Grammar | |
Résultat | Illuminate\Database\Grammar |
protected array $config | ||
Résultat | array |
protected string $database | ||
Résultat | string |
protected Connection,Doctrine\DBAL $doctrineConnection | ||
Résultat | Doctrine\DBAL\Connection |
protected Dispatcher,Illuminate\Contracts\Events $events | ||
Résultat | Illuminate\Contracts\Events\Dispatcher |
protected mixed $fetchArgument | ||
Résultat | mixed |
protected array $fetchConstructorArgument | ||
Résultat | array |
protected int $fetchMode | ||
Résultat | integer |
protected bool $loggingQueries | ||
Résultat | boolean |
protected Processor,Illuminate\Database\Query\Processors $postProcessor | ||
Résultat | Illuminate\Database\Query\Processors\Processor |
protected bool $pretending | ||
Résultat | boolean |
protected Grammar,Illuminate\Database\Query\Grammars $queryGrammar | ||
Résultat | Illuminate\Database\Query\Grammars\Grammar |
protected array $queryLog | ||
Résultat | array |
protected PDO $readPdo | ||
Résultat | PDO |
protected callable $reconnector | ||
Résultat | callable |
protected Grammar,Illuminate\Database\Schema\Grammars $schemaGrammar | ||
Résultat | Illuminate\Database\Schema\Grammars\Grammar |
protected string $tablePrefix | ||
Résultat | string |
protected int $transactions | ||
Résultat | integer |