quiquegilb / global-api-criteria
Global criteria php
dev-main
2021-06-24 08:00 UTC
Requires
- php: >=7.3
Requires (Dev)
- ext-json: *
- ext-pdo: *
- doctrine/orm: ^2.8
- illuminate/database: ^8.22
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.2
This package is auto-updated.
Last update: 2025-04-24 17:14:11 UTC
README
Installation
Use the package manager composer to install Global Api Criteria.
composer require quiquegilb/global-api-criteria
Usage
Simple usage.
$criteria = Criteria::create() ->withFilter(FilterGroup::deserialize('(name like computer or name like pc) and price > 500 and price <= 1000')) ->withOrder(OrderGroup::deserialize('+price, stock desc')) ->withPaginate(Paginate::create(0, 5));
Custom and security usage
View ProductCriteriaExample for more details.
$criteria = ProducCriteriaExample::create() ->withFilter(FilterGroup::deserialize('(name like computer or name like pc) and price > 500 and price <= 1000')) ->withOrder(OrderGroup::deserialize('+price, stock desc')) ->withPaginate(Paginate::create(0, 5));
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)