Review main Abandoned

59412[BUGFIX] Remove strict type for conditions in QueryBuilder

Stefan Froemken CR 0 V 0 Easy +4 −4 updated 01/14/19, 08:24

Commit message

Add possibility to add addX/orX functionality to all
join* methods in TYPO3 QueryBuilder.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 1012

  1. Stefan Froemken uploaded patch set 1 01/11/19, 15:04

  2. Mathias Brodala commented on patch set 1 01/11/19, 15:08

    QueryBuilder.php:522

    What else besides "string" can this be then?
  3. TYPO3com voted on patch set 1 V +1 01/11/19, 15:16 Completed build in 12m 25s on Fri, 11 Jan, 04:16 PM Test Summary: 47641 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31435

  4. Stefan Froemken commented on patch set 1 01/11/19, 15:17

    Keep it empty like the original/professional/mostUsed DBAL system for PHP projects does: public function leftJoin($fromAlias, $join, $alias, $condition = null)
  5. Benni Mack updated the commit message in patch set 2 01/11/19, 19:47

  6. TYPO3com voted on patch set 2 V +1 01/11/19, 20:00 Completed build in 12m 17s on Fri, 11 Jan, 09:00 PM Test Summary: 47645 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31456

  7. Alexander Schnitzler commented on patch set 2 01/11/19, 20:58

    So, you want to be able to put in an expression object there instead of a string? Or do you want to allow null here? Like ?string ?
  8. Stefan Froemken commented on patch set 2 01/12/19, 15:12

    Yes, I want to put in an ExpressionCondition object there. The other way around, would be to remove the @internal of getConcreteQueryBuilder()
  9. Oliver Klee commented on patch set 2 CR -1 01/12/19, 15:43

    QueryBuilder.php:526

    Should it still always be a string? Then the parameter type needs to stay. Otherwise, the @param annotation needs to be adapted accordingly.
  10. Alexander Schnitzler commented on patch set 2 01/13/19, 09:08

    Just a short remark: @Stefan: Do you know you can also just cast the expression to a string instead of passing it on as an object? $query->join('a', 'table', 'b', (string)$queryBuilder->expr->andX(...)); So, technically, using complex expressions as on clause are possible.
  11. Stefan Froemken commented on patch set 2 01/14/19, 06:59

    Good morning, as I now have two possibilities to solve that, this ticket can be closed now. Please use getConcreteQueryBuilder()->leftJoin or cast ExpressionCondition to string. Perfekt.
  12. Mathias Brodala abandoned the change 01/14/19, 08:24

    due to different solution.