Download the PHP package api-skeletons/doctrine-criteria without Composer
On this page you can find all versions of the php package api-skeletons/doctrine-criteria. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download api-skeletons/doctrine-criteria
More information about api-skeletons/doctrine-criteria
Files in api-skeletons/doctrine-criteria
Package doctrine-criteria
Short Description Doctrine Criteria from Array Parameters
License BSD-3-Clause
Homepage https://api-skeletons.com
Informations about the package doctrine-criteria
Doctrine Criteria for Laminas
This library builds a Criteria object from array parameters for use in filtering collections.
Installation
Installation of this module uses composer. For composer documentation, please refer to getcomposer.org.
Once installed, add ApiSkeletons\Doctrine\Criteria
to your list of modules inside
config/application.config.php
or config/modules.config.php
.
laminas-component-installer
If you use laminas-component-installer, that plugin will install doctrine-criteria as a module for you.
Configuring the Module
Copy config/apiskeletons-doctrine-criteria.global.php.dist
to config/autoload/apiskeletons-doctrine-criteria.global.php
and edit the list of aliases for those you want enabled. By default all supported expressions are enabled.
Note AND and OR composite expressions are not supported yet.
Use
Filters
Filters are not simple key/value pairs. Filters are a key-less array of filter definitions. Each filter definition is an array and the array values vary for each filter type.
Each filter definition requires at a minimum a 'type'. A type references the configuration key such as 'eq', 'neq', 'contains'.
Each filter definition requires at a minimum a 'field'. This is the name of a field on the target entity.
Each filter definition may specify 'where' with values of either 'and', 'or'.
Format of Date Fields
When a date field is involved in a filter you may specify the format of the date using PHP date
formatting options. The default date format is ISO 8601 Y-m-d\TH:i:sP
If you have a date field which is
just Y-m-d
then add the format to the filter. For complete date format options see
DateTime::createFromFormat
Included Filter Types
Equals:
Doctrine Collections does not currently support DateTime
Equals
comparisons. Any DateTime values sent through theequals
filter will always return not equals. This is a shortcoming of doctrine/collections and not this module. Other comparison operators should work as expected.
Not Equals:
Less Than:
Less Than or Equals:
Greater Than:
Greater Than or Equals:
Contains:
Used to search inside of a string. Comlimentary with Starts With & Ends With, contains matches a string inside any part of the value.
Starts With:
Ends With:
Member Of:
Used to search inside an array field to match the matchValue to an array element.
In:
Note: Dates in the In and NotIn filters are not handled as dates. It is recommended you use other filters instead of these filters for date datatypes.
NotIn:
Note: Dates in the In and NotIn filters are not handled as dates. It is recommended you use other filters instead of these filters for date datatypes.
IsNull:
Used to determine if the field is null. There is no corresponding IsNotNull.
OrderBy
Field:
All versions of doctrine-criteria with dependencies
doctrine/collections Version ^1.5
doctrine/doctrine-module Version ^1.2 || ^2.1
doctrine/doctrine-orm-module Version ^1.1 || ^2.1
laminas/laminas-modulemanager Version ^2.7.2
laminas/laminas-servicemanager Version ^2.7.6 || ^3.1.1
laminas/laminas-dependency-plugin Version ^1.0