Download the PHP package rekalogika/doctrine-advanced-group-by without Composer
On this page you can find all versions of the php package rekalogika/doctrine-advanced-group-by. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rekalogika/doctrine-advanced-group-by
More information about rekalogika/doctrine-advanced-group-by
Files in rekalogika/doctrine-advanced-group-by
Package doctrine-advanced-group-by
Short Description Allows the use of the more complex GROUP BY clauses in Doctrine ORM. These include GROUPING SETS, CUBE, and ROLLUP.
License MIT
Homepage https://rekalogika.dev/doctrine-advanced-group-by
Informations about the package doctrine-advanced-group-by
rekalogika/doctrine-advanced-group-by
Allows the use of the more complex GROUP BY clauses in Doctrine ORM.
These include GROUPING SETS, CUBE, and ROLLUP.
If you are not familiar with these clauses, you can read more about them in the PostgreSQL documentation.
Full documentation is available at rekalogika.dev/doctrine-advanced-group-by.
Supported Databases
Only PostgreSQL is currently supported. The generated SQL uses
GROUP BY DISTINCT, which requires PostgreSQL 14 or later. MS SQL Server
support is possible in the future. Other Doctrine-supported databases do not
have the functionality and cannot be supported, at least not completely.
Installation
Usage
Flattening
It is possible to flatten a GroupBy object into another instance of GroupBy
with a single level of grouping sets.
In the example above, $groupBy2 is the flattened version of $groupBy1.
You can transform $groupBy1 into $groupBy2 using the flatten method.
This is useful if you need to know if the GroupBy generates more than
4096 grouping sets, which is the limit of the database. Or, you can use it
to split the query into multiple smaller queries.
GROUPING() DQL Function
If you are using ROLLUP, CUBE, or GROUPING SETS, you also probably need to
use the GROUPING() function. This package provides a DQL function for the
GROUPING() function that you can use in a DQL Query or QueryBuilder.
Registration without framework:
Registration with Symfony:
Limitations
Works using a custom SQL walker; therefore, it is not possible if you need to use a custom SQL walker for another purpose.
Documentation
rekalogika.dev/doctrine-advanced-group-by
License
MIT
Contributing
Issues and pull requests should be filed in the GitHub repository rekalogika/doctrine-advanced-group-by.