PHPackages                             arrilot/collectors - 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. arrilot/collectors

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

arrilot/collectors
==================

0.2.3(8y ago)12.0k1MITPHPPHP &gt;=5.6.0

Since Feb 10Pushed 8y agoCompare

[ Source](https://github.com/arrilot/collectors)[ Packagist](https://packagist.org/packages/arrilot/collectors)[ Docs](https://github.com/arrilot/collectors)[ RSS](/packages/arrilot-collectors/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (2)Versions (10)Used By (1)

[![Latest Stable Version](https://camo.githubusercontent.com/dace1718bec3be9d851d4dc67d3456e8f7c2f02f0888a526e89fd99ca59273cf/68747470733a2f2f706f7365722e707567782e6f72672f617272696c6f742f636f6c6c6563746f72732f762f737461626c652e737667)](https://packagist.org/packages/arrilot/collectors/)[![Total Downloads](https://camo.githubusercontent.com/b8cfd2d2d1907ae43d5e96ea69caabb16174d43073e48ac86fb62317531392e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617272696c6f742f636f6c6c6563746f72732e7376673f7374796c653d666c6174)](https://packagist.org/packages/Arrilot/collectors)[![Build Status](https://camo.githubusercontent.com/5e0915cfee894395db986ff6c3e1f0be9b2c26bd3023eb5e407bbbc7cfea742a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f617272696c6f742f636f6c6c6563746f72732f6d61737465722e7376673f7374796c653d666c6174)](https://travis-ci.org/arrilot/collectors)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/7f1332199a31be086a4a8dadd9423fd688e4c20889a17062d91ba578f4cd05c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f617272696c6f742f636f6c6c6563746f72732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/arrilot/collectors/)

PHP Collectors (In development)
===============================

[](#php-collectors-in-development)

Introduction
------------

[](#introduction)

Collectors scan across given fields in items/collections for ids and fetch detailed data from database or another storage

Installation
------------

[](#installation)

`composer require arrilot/collectors`

Usage
-----

[](#usage)

First of all you need to create your own collector class.

```
use Arrilot\Collectors\Collector;

class FooCollector extends Collector
{
    /**
     * Get data for given ids.
     *
     * @param array $ids
     * @return array
     */
    public function getList(array $ids)
    {
        ...
    }
}
```

Example

```
    $elements = [
        ['id' => 1, 'files' => 1],
        ['id' => 2, 'files' => [2, 1]],
    ];

    $item = [
        'id' => 3,
        'another_files' => 3
    ];

    $collector = new FooCollector();
    $collector->scanCollection($elements, 'files');
    $collector->scanItem($item, 'another_files');
    // You can also pass several fields as array  - $collector->scanItem($item, ['field_1', 'field_2']);

    $files = $collector->performQuery();
    var_dump($files);

    // result
    /*
        array:2 [▼
          1 => array:3 [▼
              "id" => 1
              "name" => "avatar.png",
              "module" => "main",
          ]
          2 => array:3 [▼
              "id" => 2
              "name" => "test.png",
              "module" => "main",
          ],
          3 => array:3 [▼
               "id" => 3
               "name" => "test2.png",
               "module" => "main",
          ],
        ]
    */
```

You can manually add additional ids if you already know them.

```
$files = $collector->addIds([626, 277, 23])->performQuery();
```

You can pass `select` to `getlist` like that:

```
$files = $collector->select(['id', 'name'])->performQuery();
// $this->select is ['id', 'name'] in `->getList()` and you can implement logic handling it.
```

Same is true for an additional filter.

```
$collector->where(['active' => 1])->performQuery();
// $this->where is ['active' => 1]
```

You can use dot notation to locate a field, e.g

```
$collector->fromItem($item, 'properties.files');
```

Bridge packages
---------------

[](#bridge-packages)

- [Bitrix (russian)](https://github.com/arrilot/bitrix-collectors)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Recently: every ~74 days

Total

9

Last Release

3126d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58d505cd6b2551974b0c076d133fd9a3c9cd635bbf308adb17a6399bd3b63232?d=identicon)[Arrilot](/maintainers/Arrilot)

---

Top Contributors

[![arrilot](https://avatars.githubusercontent.com/u/2826480?v=4)](https://github.com/arrilot "arrilot (20 commits)")

---

Tags

collectors

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arrilot-collectors/health.svg)

```
[![Health](https://phpackages.com/badges/arrilot-collectors/health.svg)](https://phpackages.com/packages/arrilot-collectors)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[illuminate/pipeline

The Illuminate Pipeline package.

9348.3M267](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10533.5M991](/packages/illuminate-pagination)[illuminate/redis

The Illuminate Redis package.

8314.4M363](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

224.5M132](/packages/illuminate-cookie)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
