dep: package update

This commit is contained in:
2021-11-08 16:10:01 +09:00
parent 38208750e7
commit 2c533d2ab3
783 changed files with 4581 additions and 20980 deletions
+24
View File
@@ -161,6 +161,13 @@ class Connection implements ConnectionInterface
*/
protected $pretending = false;
/**
* All of the callbacks that should be invoked before a query is executed.
*
* @var array
*/
protected $beforeExecutingCallbacks = [];
/**
* The instance of Doctrine connection.
*
@@ -641,6 +648,10 @@ class Connection implements ConnectionInterface
*/
protected function run($query, $bindings, Closure $callback)
{
foreach ($this->beforeExecutingCallbacks as $beforeExecutingCallback) {
$beforeExecutingCallback($query, $bindings, $this);
}
$this->reconnectIfMissingConnection();
$start = microtime(true);
@@ -807,6 +818,19 @@ class Connection implements ConnectionInterface
$this->setPdo(null)->setReadPdo(null);
}
/**
* Register a hook to be run just before a database query is executed.
*
* @param \Closure $callback
* @return $this
*/
public function beforeExecuting(Closure $callback)
{
$this->beforeExecutingCallbacks[] = $callback;
return $this;
}
/**
* Register a database query listener with the connection.
*