quiquegilb/global-api-criteria

dev-main 2021-06-24 08:00 UTC

This package is auto-updated.

Last update: 2024-05-24 15:07:44 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

MIT

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal