-
-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle multiple EntityManager
prefixes
#3142
Conversation
Update TablePrefix.php Update TablePrefixTrait.php
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @matesko 👍
I wonder why the tests aren't running on this PR, though.. 🤔 |
@@ -23,6 +23,7 @@ class Version | |||
public function __construct(Connection $connection, string $tablePrefix = 'bolt') | |||
{ | |||
$this->connection = $connection; | |||
$tablePrefix = is_array($tablePrefix) ? $tablePrefix['default'] : $tablePrefix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strict_types
is true, so tablePrefix
can never be an array, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are corect! I updated the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string|array
won't work. Union types are only allowed in PHP 8 and up.. Perhaps do it like this, then?
/**
* @param string|array $tablePrefix
*/
public function __construct(Connection $connection, $tablePrefix = 'bolt')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, pushed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @matesko
EntityManager
prefixes
Update TablePrefix.php
Update TablePrefixTrait.php
Update Vresion.php