Download the PHP package bugloos/query-sorting-bundle without Composer

On this page you can find all versions of the php package bugloos/query-sorting-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package query-sorting-bundle

Query Sorting Bundle

Scrutinizer Code Quality GitHub Workflow Status Code Intelligence Status

What does it do? :)

The query sorting bundle allows you to sort data from QueryBuilder and the Database. you can sort multiple columns at the same time and also you can sort relation fields with two-level deep and without any join in your query builder.

Installation:

Compatibility

Usage

Suppose our database has the following tables with the following relations

Now we want to show the Book entity by sorting

We want sort Book entity by price column, so we can send sort data by Querystring or make inline with array like this:

You just need to add Sorting class in controller the call sort method:

The following code is in Book controller.

As you see, At first you should call for() method and pass QueryBuilder as parameter to this method

Then call parameters() method and pass orders request items

At the end you should call sort() method to run sorting

The return of sort method is Query Builder, so you can add anything else to Query Builder after sorting.

If you want to sort the ManyToOne relation field or one level deep relation, you should add mapper.

To add a mapper, you call addMapper() method to add single mapper or call mappers() method to send multiple mappers with array

First parameter of addMapper() method is parameter name and second parameter is relation name and its field name, which separate by " . " sign

For example we want to sort Book entity by its Country name. Book has ManyToOne relation with Country entity

The following code is in Book controller.

NOTE: There is no need to add your relationship join in Query builder because if join is not added, I will add it automatically. ;)

If you want to sort the ManyToMany relation field or two level deep relation, you should again add mapper

For example we want to sort Book entity by its Writer age. Book has ManyToMany relation with User entity

The following code is in Book controller.

NOTE: You should know that you can sort data with multiple columns too, you just need to send multiple order data with a Query string like this:

Suggestion

You can change two parameters with the config file, just make a yaml file in config/packages/ directory then you can change default cache time for queries and default relation separator as follows:

NOTE: You can set the cache time for each query separately and if you don't set any cache time, it uses default cache time in your config file

Contributing v beer

If you find an issue, or have a better way to do something, feel free to open an issue or a pull request.


All versions of query-sorting-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/doctrine-bundle Version ^2.2
doctrine/orm Version ^2.8
symfony/http-kernel Version ^4.4 | ^5.4 | ^6.0
psr/cache Version ^1.0 | ^2.0 | ^3.0
symfony/orm-pack Version ^2.2
symfony/framework-bundle Version ^4.4 | ^5.4 | ^6.0
doctrine/annotations Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bugloos/query-sorting-bundle contains the following files

Loading the files please wait ....