Download the PHP package bentools/opencubes without Composer
On this page you can find all versions of the php package bentools/opencubes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package opencubes
OpenCubes
OpenCubes is a framework-agnostic set of components that parses PSR-7 URIs into value objects:
- Pagination
- Filters
- Sorting
- Breakdown (group by)
Overview
Look at the following URL:
Here's how OpenCubes parses it:
Now, we can ask our persistence system (Doctrine, ElasticSearch, Solr, 3rd-party API, ...) to return books:
- From offset
100
, limit to50
items - Ordered by
author.name
(use your own logic to parse the field path) - Published between
2019-01-01
and2019-01-31
- In category id
12
- Matching tag
foo
ORbar
(AND clauses can also be set) - But their names MUST NOT start by
foo
.
Translating these value objects to query your database or API is now up to you! OpenCubes provides no bridge for the moment, but maybe in a near future.
Customization
Each component comes with a lot of customization possibilities (query parameters, default settings, ...).
Read More...
Besides, you can also create your own URI parsers / builders by implementing the appropriate interfaces.
HATEOAS
OpenCubes brings HATEOAS to your application by providing links for each component:
- Page / PageSize links
- Apply / remove sort link
- Apply / remove filter
- ...
Each native component comes with a default JSON serialization which exposes the appropriate Urls. Being JSONserializable is not mandatory for your own components, it has been designed for a ready-to-use implementation. Different serializations can be achieved through your favourite serializer (Symfony / JMS to name a few).
Read More...
Dive into components
- The Pager Component
- The Sort Component
- The Filter Component
- The BreakDown Component
Installation
OpenCubes is still at its early stage of development and subject to breaking changes.
Feel free to contribute or report any issue.
Tests
License
MIT.
All versions of opencubes with dependencies
ext-json Version *
bentools/iterable-functions Version ~1.2
bentools/querystring Version ~1.0,>=1.0.2
bentools/uri-factory Version ~1.1|~2.0
symfony/options-resolver Version ~2.6|~3.0|~4.0