• v1.0.0-beta10 d067f8983f

    v1, Beta 10 Pre-Release

    danieljsummers released this 2024-09-27 02:30:09 +00:00 | 2 commits to main since this release

    Lots of good stuff here!

    • There are two new field comparisons; in implements an IN comparison against a field, and inArray does the same thing for fields that are themselves JSON arrays.
    • The Find functions (except byId) now support an array of Fields, as their last parameter, which will be used to order the results. There is also a new Field::named() function which can be used to create field definitions for this purpose. These names follow the same rules as other field names (use "a.b.c" for nested fields), but they support other features as well.
      • To sort descending, include DESC in the name (ex. Field::named('code DESC')).
      • To specify a null clause, include it as well (ex. Field::named('example NULLS FIRST')).
      • To sort the field as a number, prefix the field name with n: (ex. Field::named('n:ranking')). PostgreSQL will cast the field to a number, while SQLite will do its usual best-guess.
      • To sort case-insensitively, prefix the field name with i: (ex. Field::named('i:comment')). SQLite's default is case-sensitive sorting, with uppercase values first. PostgreSQL's behavior is based on libraries in the underlying operating system; some are case-insensitive by default, but others (particularly Mac OS) are case-sensitive.
    • The names of the comparisons in Field constructor functions are now spelled out (ex. Field::equal instead of Field::EQ). The two-character versions remain as aliases, so this will not break existing code.
    • The project now comes back clean for PHPStan level 6, and had some changes flagged on higher levels. One of these changes may fix an issue where IDEs were not picking up the generic type coming from DocumentList->items().
    Downloads