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

Predictable QueryBuilder::executeQuery() and QueryBuilder::executeStatement() #4578

Merged

Commits on Apr 6, 2021

  1. Predictable QueryBuilder::executeQuery() and `QueryBuilder::execute…

    …Statement()`
    
    This deprecates `QueryBuilder::execute()`, because its return type is
    unpredictable and raises issues with static analysis tools such as PHPStan.
    
    Instead you should use either `QueryBuilder::executeQuery()` or
    `QueryBuilder::executeStatement()`, depending on whether the queryBuilder is a query (SELECT)
    or a statement (INSERT, UPDATE, DELETE).
    
    You might also consider the use of the new shortcut methods, such as:
    
    - `fetchAllAssociative()`
    - `fetchAllAssociativeIndexed()`
    - `fetchAllKeyValue()`
    - `fetchAllNumeric()`
    - `fetchAssociative()`
    - `fetchFirstColumn()`
    - `fetchNumeric()`
    - `fetchOne()`
    
    This commit is a direct follow-up to doctrine#4461
    where those shortcut methods where introduced.
    PowerKiKi committed Apr 6, 2021
    Copy the full SHA
    7b5dd78 View commit details
    Browse the repository at this point in the history