Skip to content

Commit 138b0d6

Browse files
committed
Readme updates
1 parent baafcf8 commit 138b0d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ All of the above exceptions are programmer errors and strictly enforced. Empty q
126126
If you set a field to the wrong type, the library logs a warning then converts the type via the appropriate PHP cast.
127127

128128
## Multiple Database Support
129-
While this is primarily a single database ORM, you can switch databases at run time. Save the value from `$connectionId = \PHPFUI\ORM::addConnection($pdo);` and then call `\PHPFUI\ORM::useConnection($db);` to switch. `\PHPFUI\ORM::addConnection` will set the current connection.
129+
While this is primarily a single database ORM, you can switch databases at run time. Save the value from `$connectionId = \PHPFUI\ORM::addConnection($pdo);` and then call `\PHPFUI\ORM::useConnection(connectionId);` to switch. `\PHPFUI\ORM::addConnection` will set the current connection.
130130

131131
The programmer must make sure the proper database is currently selected when database reads or writes happen and that any primary keys are correctly handled.
132132

133133
### Copy tables example:
134134
```php
135-
// get the current connection just for fun
135+
// get the current connection to restore later
136136
$currentConnection = \PHPFUI\ORM::getConnection();
137137

138138
$cursors = [];
@@ -141,7 +141,7 @@ $cursors[] = (new \App\Table\Author())->getRecordCursor();
141141
$cursors[] = (new \App\Table\Book())->getRecordCursor();
142142

143143
// set up a new database connection
144-
$pdo = new \PDO($newConnectionString);
144+
$pdo = new \PHPFUI\ORM\PDOInstance($newConnectionString);
145145
$newConnectionId = \PHPFUI\ORM::addConnection($pdo);
146146

147147
foreach ($cursors as $cursor)

0 commit comments

Comments
 (0)