Download the PHP package demos-europe/edt-dql without Composer

On this page you can find all versions of the php package demos-europe/edt-dql. 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 edt-dql

DoctrineQueryGenerator

Extends edt/queries with support for Doctrine ORM.

Also functions as helper library for Doctrine ORM to generate DQL queries. Currently, the focus lies in the detection of join clauses from a given property path to sort and filter the result set.

A basic understanding of the Doctrine ORM by the user is assumed for this library to be used.

Example

Suppose we have a Book, Person and Address entity.

A Book has an author property which references Person entity.

A Person has a birth property containing information about the birth location and date.

An Birth entity has a country property which is a string.

The goal is to get all Book entities of which the author was born in the USA. This could be done by first fetching all entities from the database and filter the result in PHP. But for performance and memory reasons it makes sense to execute the filter in the database.

With DQL we could create a query with two joins to get the desired result:

This library can generate a similar query builder from the following code:

The main advantage of the second version does not lie in line count or readability but in the removal of the need to manually specify the query in detail. This allows dynamically receiving queries and directly executing them in the database (provided authorization and validation is checked beforehand).

Conditions

Beside the PropertyHasValue shown above more condition types are supported. All conditions provided by the library can be found and created using the DqlConditionFactory class.

If the provided conditions do not suffice you can write you own clauses by implementing ClauseInterface.

Condition Nesting

Conditions can be grouped together using AND or OR conjunctions:

Sorting

Defining the sorting can be done similarly as defining conditions. In the following example books will be sorted by their authors name as first priority and the authors birthdate as second priority.

If the provided sort implementations do not suffice you can write you own sort implementation.

Credits and acknowledgements

Conception and implementation by Christian Dressler with many thanks to eFrane.


All versions of edt-dql with dependencies

PHP Build Version
Package Version
Requires doctrine/orm Version ^2.5
php Version ^8.1
demos-europe/edt-queries Version ^0.26
demos-europe/edt-paths Version ^0.26
nette/php-generator Version ^4.0
symfony/cache Version ^5 || ^6 || ^7
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 demos-europe/edt-dql contains the following files

Loading the files please wait ....