Skip to content
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

Merged
merged 7 commits into from
Mar 25, 2022
Merged

Conversation

matesko
Copy link
Contributor

@matesko matesko commented Mar 25, 2022

Update TablePrefix.php

Update TablePrefixTrait.php

Update Vresion.php

Update TablePrefix.php

Update TablePrefixTrait.php
Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @matesko 👍

@bobdenotter
Copy link
Member

I wonder why the tests aren't running on this PR, though.. 🤔

@bobdenotter bobdenotter reopened this Mar 25, 2022
@@ -23,6 +23,7 @@ class Version
public function __construct(Connection $connection, string $tablePrefix = 'bolt')
{
$this->connection = $connection;
$tablePrefix = is_array($tablePrefix) ? $tablePrefix['default'] : $tablePrefix;
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, pushed...

Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @matesko

@bobdenotter bobdenotter merged commit 923277e into bolt:master Mar 25, 2022
@bobdenotter bobdenotter changed the title Multiple EntityManagers prefixes Handle multiple EntityManager prefixes Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants