Download the PHP package silpo-tech/filter-bundle without Composer

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

Filter Bundle

CI codecov License: MIT

About

The Filter Bundle contains mapping and criteria builder

Installation

Require the bundle and its dependencies with composer:

Register the bundle:

Usage

  1. Action:

  2. Repository method

Filter DTO example:

Search Filter

If Doctrine ORM or MongoDB ODM support is enabled, adding filters is as easy as registering a filter service in the api/config/services.yaml file and adding an attribute to your resource configuration.

The search filter supports exact, partial, start, end, and word_start matching strategies:

Prepend the letter i to the filter if you want it to be case insensitive. For example ipartial or iexact. Note that this will use the LOWER function and will impact performance if there is no proper index.

Case insensitivity may already be enforced at the database level depending on the collation used. If you are using MySQL, note that the commonly used utf8_unicode_ci collation (and its sibling utf8mb4_unicode_ci) are already case-insensitive, as indicated by the _ci part in their names.

You can dynamically change the strategy to filters from the client, for this behavior your dto must implement StrategyInterface: ?filter[title:istart]=Ukrainian

Example syntax for exact strategy: ?filter[status][0]=new&filter[status][1]=completed

Date Filter

Usage syntax: ?filter[createdAt][from]=2022-05&filter[createdAt][to]=2022-06

Managing null Values

The date filter is able to deal with date properties having null values. Four behaviors are available at the property level of the filter via the arguments parameter:

Description Strategy to set
Use the default behavior of the DBMS null (default)
Exclude items exclude_null
Consider items as oldest include_null_before
Consider items as youngest include_null_after
Always include items include_null_before_and_after

To configure null management for a date property, pass the nullManagement key in the arguments array of the #[ApiFilter] attribute:

Behavior details:

You can also combine nullManagement with other DateFilter arguments like compareDateToDateTime or convertToTz:

Order Filter (Sorting)

The order filter allows to sort a collection against the given properties.

Syntax: ?filter[sort][0]=-createdAt&filter[sort][0]=updatedAt

By default, whenever the query does not specify the direction explicitly (e.g.: ?filter[sort][0]=-createdAt), filters will not be applied unless you configure a default order direction to use.

Constraints

ValidDateRange

Validates that given array value is a valid date range, e.g. property is an array with two keys: from, to; array values should date string of valid format, default format is Y-m-d

Basic usage

Options

format

Defines date string format

invalidDateTimeMessage

Message that will be shown if from or to values are not valid date string

invalidDateRangeMessage

Message that will be shown if from is greater than to

min

If provided additional check will be performed to check to is greater than from for at least min value. Value should be valid DateInterval string with leading plus sign, e.g. +1 sec, +2 hour 3 min.

max

If provided additional check will be performed to check to is greater than from for at most max value. Value should be valid DateInterval string with leading plus sign, e.g. +1 sec, +2 hour 3 min.

minMessage

Message that will be shown if to is not greater than from for at least min value

maxMessage

Message that will be shown if to is greater than from for more than max value


All versions of filter-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
symfony/dependency-injection Version ^7.0
symfony/validator Version ^7.0
symfony/config Version ^7.0
symfony/property-access Version ^7.0
symfony/orm-pack Version ^1.0
silpo-tech/mapper-bundle Version ^1.0
silpo-tech/exception-handler-bundle Version ^2.0
symfony/yaml Version ^7.2
symfony/framework-bundle Version ^7.2
silpo-tech/rest-bundle 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 silpo-tech/filter-bundle contains the following files

Loading the files please wait ...