Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1581,4 +1581,9 @@ abstract public function getSupportForTransactionRetries(): bool;
* @return bool
*/
abstract public function getSupportForNestedTransactions(): bool;

/**
* @return mixed
*/
abstract public function getDriver(): mixed;
}
9 changes: 9 additions & 0 deletions src/Database/Adapter/Mongo.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ public function __construct(Client $client)
$this->client->connect();
}

/**
* Returns the current Mongo client
* @return mixed
*/
public function getDriver(): mixed
{
return $this->client;
}

public function setTimeout(int $milliseconds, string $event = Database::EVENT_ALL): void
{
if (!$this->getSupportForTimeouts()) {
Expand Down
5 changes: 5 additions & 0 deletions src/Database/Adapter/Pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ public function delegate(string $method, array $args): mixed
});
}

public function getDriver(): mixed
{
return $this->delegate(__FUNCTION__, \func_get_args());
}

public function before(string $event, string $name = '', ?callable $callback = null): static
{
$this->delegate(__FUNCTION__, \func_get_args());
Expand Down
10 changes: 10 additions & 0 deletions src/Database/Adapter/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -2179,12 +2179,22 @@ protected function applyOperatorToValue(Operator $operator, mixed $value): mixed
/**
* Returns the current PDO object
* @return mixed
* @deprecated Use getDriver() instead
*/
protected function getPDO(): mixed
{
return $this->pdo;
}

/**
* Returns the current PDO object
* @return mixed
*/
public function getDriver(): mixed
{
return $this->pdo;
}

/**
* Get PDO Type
*
Expand Down
Loading