Download the PHP package taranovegor/searcher-bundle without Composer

On this page you can find all versions of the php package taranovegor/searcher-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 searcher-bundle

taranovegor/searcher-bundle

Filter, sort and paginate search component for Symfony applications, decoupled from any single persistence backend.

A SearchDefinition declares what a search is allowed to do — which fields are filterable and with which operators, which are sortable, how pagination is bounded. Everything a client sends that the definition did not declare is dropped, so the query string can never reach further into your schema than you explicitly allowed.

Requirements

Install

Quick start

Define what a search is allowed to do:

Bind a controller argument with #[MapSearch] and run the search:

Query string conventions

Filters

Operators: eq, neq, gt, gte, lt, lte, in, notIn, like (like matches the value as a literal substring — %/_ in it are escaped).

A filter for an undeclared field is ignored. A condition using an operator the field was not declared with is ignored (and logged at notice level). A value failing one of the field's constraints rejects the whole request — the HTTP resolver turns that into a 422 response.

Sorting and pagination

A missing or invalid limit falls back to the definition's defaultLimit. Clients can never request an unbounded result set; unbounded queries are a server-side capability (PaginationDetails::unlimited()).

Definition features

Renaming: API field vs. property

Clients use the API name; queries use the property. For the Doctrine adapter the property must be a scalar field of the root entity — filtering through a relation needs a filter handler.

Input transformers

Normalize a client value before validation and execution:

Filter handlers

Custom query logic — joins, computed expressions — for one filter:

The context exposes join(), leftJoin(), andWhere(), addOrderBy(), expr(), setParameter() and uniqueParameterName(). Take bound-parameter names from uniqueParameterName() so handlers cannot collide with each other or with standard filters; alias joins after the field being filtered.

Deduplicating joined to-many filters

When a filter handler joins a to-many relation, the SQL result fans out to one row per match. That inflates the reported total and breaks page windows: LIMIT/OFFSET cut raw SQL rows before Doctrine's hydrator collapses duplicates, so a page can come back short. Opt in to deduplication per definition:

The searcher then applies SELECT DISTINCT and counts COUNT(DISTINCT <identifier>). It is not the default because SELECT DISTINCT requires every ORDER BY expression to be part of the selected columns, which conflicts with handlers ordering by a joined, non-selected expression.

Server-side criteria

Force criteria on top of whatever the client sent, without mutating the DTO:

Extra filters are merged with the client's; server sorting (once set) replaces client sorting entirely; a pagination override replaces the client's pagination.

SearchResult::map() converts entities to response DTOs while keeping the pagination metadata:

Custom request conventions

SearchDtoValueResolver implements the filter[...]/sort/limit convention above. To support a different one (e.g. flat ?status=x&cities[]=1 parameters), extend AbstractSearchDtoResolver and override extractFilterParams(); validation, transformers and handlers are unaffected. Note that string values still go through the operator:value / ; parsing — override scope is where filter values come from, not their syntax.

Development

License

MIT, see LICENSE.


All versions of searcher-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
psr/container Version ^1.1 || ^2.0
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/validator Version ^6.4 || ^7.0 || ^8.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 taranovegor/searcher-bundle contains the following files

Loading the files please wait ...