Download the PHP package adt/base-query without Composer

On this page you can find all versions of the php package adt/base-query. 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 base-query

Doctrine Components

Install

Creating a QueryObject class

Method getEntityClass

The getEntityClass method must be specified and return your entity class.

Method setDefaultOrder

The setDefaultOrder method must be specified and set the default order.

Method init

The init method is used to specify default filters and order. You have to always call parent::init() when you use it.

Callback array filter

filter is array of callbacks which will be applied on QueryBuilder when created.

Similarly you can use order callback for setting the query object order.

Method by and orderBy

Method by is a shortcut for creating filter callbacks. It offers some useful features:

Method orderBy is a shortcut for setting order callback.

You can use dot notation to auto join other entities (left join is used).

Basic usage

Creating an instance

or better with the use of a factory:

`

together with neon:

Fetch results

Count results

Disable default filters

Pagination

`

Advanced features

Manul joins

For manual joins you should use innerJoin and leftJoin methods:

Unlike QueryBuilder::innerJoin and QueryBuilder::leftJoin, this ensures that same joins are not used multiple times and don't throw an error.

More columns

Don't use addSelect inside a filter callback. Use initSelect method instead:

Or create your own fetching method:

When there are more columns specified, default fetch* method won't work.

More complex sorting

You can create your own sorting callback instead of using orderBy method:

Don't forget to use AS HIDDEN in your addSelect method, otherwise the fetch* methods won't work.

Method orById

If you want to get all active records plus a specific one, you can use orById method to bypass default filters:

It's especially useful for <select>.

Use in batch processing

If you want to iterate large number of records, you can use https://github.com/Ocramius/DoctrineBatchUtils together with query object:

You should always use new EntityManager instance, not the default one (because of EntityManager::clear).

Tips


All versions of base-query with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
doctrine/orm Version ^2.18|^3.0
nette/utils Version ^3.2|^4.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 adt/base-query contains the following files

Loading the files please wait ....