PHPackages                             barnabynorman/result-set - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. barnabynorman/result-set

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

barnabynorman/result-set
========================

Manage collections of items with filters and utilities

1.13.1(1y ago)075MITPHPPHP ^7.3||^8.0CI failing

Since Oct 13Pushed 8mo agoCompare

[ Source](https://github.com/barnabynorman/result-set)[ Packagist](https://packagist.org/packages/barnabynorman/result-set)[ RSS](/packages/barnabynorman-result-set/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (1)Versions (28)Used By (0)

ResultSet
=========

[](#resultset)

ResultSet is a project based around array type data sets. I wrote the majority of the library as an Eloquent like class to query data held in JSON files. Later I used it with the output from SQL queries, creating object instances for each database row and storing them in the ResultSet held in memory, giving me an abstraction between data and logic and a fast way to get to the data without having to write queries every time. Because I held my instances of ResultSet in memory I would read from the database once and query the ResultSet multiple times, which made it fast! An older project that I had written that had multiple database queries, (and admittedly poor structure), when rewired using ResultSet went from seconds down to milliseconds - and that was on every page load!

Obviously a ResultSet is not for everybody - there are probably much better ways of working like structuring data better to start with, so that queries are required less, caching and I have not tested it with large datasets so it could run like a dog! But I like that I can take a set of data, create a ResultSet with it and have quite a powerful toolset to get at the data at my fingertips.

The ResultSet is a php ArrayObject at heart, with a bunch of methods to filter / query and manipulate the data held inside, either as objects or arrays (or both). There are no rockets involved, just plain old simple php that anyone could write, (mainly foreach loops), take a look. Its very simple to use, just create a new object or get an instance using a static method and pass in your data and start using.

Getting started
---------------

[](#getting-started)

### With Composer

[](#with-composer)

```
$ composer require barnabynorman/result-set
```

```
{
    "require": {
        "barnabynorman/result-set": "^1.00"
    }
}
```

```
