Download the PHP package aplia/filter without Composer

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

Aplia Content Filter

Advanced filter support for content objects in eZ publish legacy. The filter support nested structures with AND and OR operations and more. It effectively replaces other specific filter extensions such as OWOrFilter, as well as regular attribute filters.

This installs as an extension called apliafilter and provides an attribute filter called NestedFilterSet.

Latest Stable Version Minimum PHP Version

Installation

Install this extension using composer:

Usage

When listing content objects this filter can be enabled by installing it as an extended attribute filter, then using params to define a nested structure. The structure will then be transformed into SQL queries and added to the normal content object query.

For instance in a template one can do:

A similar example in PHP:

NestedFilterSet

An extended attribute filter which allows for nested structures and unifies attribute filters and extended attribute filter. The filter can be extended with custom classes which allows it to get around the problem that only one extended attribute filter may be used. The filter also supports filtering on multiple content classes at the same time, it will do an outer join with the attribute table in this case.

The following elements can be extended:

  1. Data-Types
  2. Modifiers
  3. Attributes

See filter.ini.append for configuration.

Syntax

The syntax of each attribute filters are an array containing the attribute name and the value, e.g.

The attribute name may also contain modifiers and an operator (default is =). e.g.

The operators supported are the same as for the attribute filters in eZ publish.

The parameters for the filter can be:

This defines a list of attribute filters with either an and or or condition between each filter. A shorthand is available by just supplying a list of attribute filters, it will then default to and as the condition.

Entries in the attrs list is either defined as an array with key and value, like this:

or as an array with each entry being an array containg the attribute name and value, like this:

The latter form allows for having the attribute name as an array of names, in which case it will filter the value on all attributes with an or condition.

The long-form of this would be:

The attribute entry may also contain the array key call, which means that a callback is used to fetch the filter structure. The callback may either return a normal structure as extended attribute filters does or return a new attribute filter structure, if the cond key is not used it will assume the and condition and wrap it into a long-form structure. The value for the call is any callback structure supported by PHP.

A full example:

Data-Types

These are handlers for the content class datatypes which allows for dynamic attribute names to be used. The content class attribute is looked up and the first handler to support the data-type will be used for creating joins and the filter.

The following specialized data-types are supported:

In addition it supports datatypes from the following extensions:

The others falls back to a default handler which uses sort_key_string or sort_key_int.

Data-Type handlers are specified using the classname with namespace prefixed.

Modifiers

Modifiers are simple callbacks which can wrap SQL functions around the fields or values.

Modifiers are specified in the attribute string, either before or after the operator. created:date would wrap the created field in a DATE() SQL call while created:=:date would wrap the matching value.

Modifiers may also be specified in the array() form of a filter as the fourth parameter. e.g.

Modifiers must be defined in filter.ini and point to a static method in a class, the method will then receive one parameter which is name of the field and the method must return a string with the SQL code which modifies the field.

e.g. to get the first letter one might do this:

First define the filter name and place the full namespace for the class + :: and the method name.

Then define the code

Attributes

Custom attributes may be added by defining the attribute name and a class to use as the handler. The modifiers and operator are parsed before calling the attribute handler.

License

This library is open-sourced software licensed under the MIT license.


All versions of filter with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3
composer/composer Version >=1.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 aplia/filter contains the following files

Loading the files please wait ....