Download the PHP package everon/criteria-builder without Composer

On this page you can find all versions of the php package everon/criteria-builder. 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 criteria-builder

Everon Criteria Builder

Library to generate complete statements, with simple, fluid and intuitive interface.

Versions

Features

No boring Sql

Focus on what's important

You can attach your own via and have easy and flexible way of generating fast sql queries without dealing with boring string concatenations, code duplication and vast amount of if/else, switch statements or constants required to handle logic related to LIMIT, OFFSET or SORT statements. All those boring parts were eliminated with .

Hammer won't do when you need a screwdriver

Putting boring stuff aside you have full control on how the is constructed, which is helpful for highly complex, complicated or very specific queries where using DQL makes things actually harder then easier. DQL is great for everyday use, however sometimes you need to express yourself in very specific way, and raw is the best way to get you there.

Translate request into something database can understand

Easy to translate request parameters into something database can understand with , statements and methods like , , or . Useful for pagination or filtering, for example.

Clear separation between , , and applying concepts like aggregation, sort, or limit. Now you can focus only on what's important, the part.

Very easy to use with thanks to

Examples

Simple Query

Will be converted into:

With parameters:

Where, orWhere, andWhere

Each statement creates new Container with Criteria object. A Criteria object contains set of Criterium objects. A Criterium is a condition.

You can append Criterium by using and methods.

Every time you use statement a new Criteria will be created, ready for new set of conditions.

Will be converted into:

With parameters:

To connect Criteria with operator use method.

Will be converted into:

RAW SQL

RAW SQL is easy to implement with methods.

Will be converted into:

Group By

Group By is easily usable with method

Will be converted into:

With parameters:

Limit and Offset

Pretty straightforward with and methods.

Will be converted into:

Order By

Order By is implemented using and keywords, in an associative array with method.

Will be converted into:

Custom Gluing

Manual Criteria handling is also possible by using the methods.

Will be converted into:

With parameters:

Operators

There are almost 20 operators ready for use like Equal, NotIn, Between or Is. Check them all here.

Equal

Will output:

NotIn

Will output:

Between

There must be exactly 2 parameters provided or an exception will be thrown.

Will output:

There are many more. See here for more examples.

Custom Operators

You can register your own Operators with:

For example:

You can use your own operator with methods.

Will output:

See https://github.com/oliwierptak/everon-criteria-builder/tree/development/src/Operator for more examples

How to use

Dependency Injection is done with Everon Factory.

Initialize with .

Setup your conditions.

Append criteria string to already existing sql.

Fetch sample data. After you attached to the , it's even easier to retrieve sql query and its parameters, with and methods like and .

Putting it all together

Test Driven

Check the tests for more examples of usage here


All versions of criteria-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8
everon/collection Version ^3
everon/factory Version ^3
everon/utils Version ^3
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 everon/criteria-builder contains the following files

Loading the files please wait ....