This function allows you to access external databases.
Parameter |
Typ |
Description |
|---|---|---|
$connectionName |
string |
Name of an external database connection, linked to the process |
The function returns an object of type JobDB, which can be used to execute statements on the database.
In case of on error, a JobRouterException is thrown.n.
Example:
$conn = $this->getDBConnection('ERP');
$result = $conn->preparedSelect(
'SELECT inv_nr, inv_title FROM INVOICES WHERE supplier_nr = :supplier_nr',
['supplier_nr' => 'S123'],
[JobRouter\Common\Database\ConnectionInterface::TYPE_TEXT],
);
$invoices = $result->fetchAll();