Download the PHP package olegario/page-search-traits without Composer
On this page you can find all versions of the php package olegario/page-search-traits. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download olegario/page-search-traits
More information about olegario/page-search-traits
Files in olegario/page-search-traits
Package page-search-traits
Short Description Library containing specialized pagination and search traits
License
Informations about the package page-search-traits
PageSearchTraits
Introducing PageSearchTraits, a library containing specialized pagination and search traits to improve the flexibility and efficiency of data access in PHP projects. Simplify your repository operations with robust functionality and easy integration.
The class uses Trait to extend its query capabilities. The added methods allow complex queries to be built, taking advantage of concepts such as field mapping and search operators.
Installation:
Examples
The $fieldMap array plays a crucial role when mapping database table fields. It is used to ensure a consistent and safe approach when referencing fields, avoiding the direct use of field names and promoting a mapping practice.
Example serach usage: search by specific field using and, for each search field a new line must be added. Performs a detailed search on a specific field using operators such as 'like', '=', or 'in'.
Example using serachOr: search for one or more specific fields using the or operator.
Example using sqlSearchOrConditions: search condition with different values for each field.
Example of using orderBy
Example of using groupBy: following the order of the fields.
Example of using join.
Example clears all values and criteria stored in the instance, allowing the same instance to be reused for a new query without interference from previous searches.