PHPackages                             jlorente/yii2-helpers - 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. jlorente/yii2-helpers

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

jlorente/yii2-helpers
=====================

A collection of Yii2 helpers with a variety of purposes

0571PHP

Since Feb 9Pushed 9y ago1 watchersCompare

[ Source](https://github.com/jlorente/yii2-helpers)[ Packagist](https://packagist.org/packages/jlorente/yii2-helpers)[ RSS](/packages/jlorente-yii2-helpers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

Yii2 Helpers
============

[](#yii2-helpers)

A collection of Yii2 helpers with a variety of purposes

Included helpers:
-----------------

[](#included-helpers)

**QueryStreamIterator** - Provides an Iterator for large query resultsets that are likely to spend a large amount of memory.

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

[](#installation)

Include the package as dependency under the bower.json file.

To install, either run

```
$ php composer.phar require jlorente/yii2-helpers "*"
```

or add

```
...
    "require": {
        // ... other configurations ...
        "jlorente/yii2-helpers": "*"
    }
```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

\###QueryStreamIterator

Imagine you have a table of cities with 1000000 rows and you want to iterate over all of them. Performing a normal query you will fetch 1000000 results at the same time and the memory consumption will increase.

This iterator allows you to wrap a QueryInterface object inside it and iterate over the whole resultset, but only fetching the number of results that you establish at the same time.

i.e.:

```
use jlorente\helpers\QueryStreamIterator;

$cities = new QueryStreamIterator([
    'query' => City::find(),
    'dataStreamSize' => 500
]);
foreach ($cities as $city) {
    echo $city->name . PHP_EOL;
}
```

Where the query property is the QueryInterface object and the dataStreamSize is number of results to fetch at the same time. You have to consider that the higher this number is, the higher the Iteration speed, but the memory comsumption will be also higher and vice versa.

License
-------

[](#license)

Copyright © 2015 José Lorente Martín . Licensed under the MIT license. See LICENSE.txt for details.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5b6d568331349beaf1945db65a076cf60e6c124d504fcb43a21937f0c85bde3?d=identicon)[jlorente](/maintainers/jlorente)

---

Top Contributors

[![jlorente](https://avatars.githubusercontent.com/u/301741?v=4)](https://github.com/jlorente "jlorente (9 commits)")

### Embed Badge

![Health badge](/badges/jlorente-yii2-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/jlorente-yii2-helpers/health.svg)](https://phpackages.com/packages/jlorente-yii2-helpers)
```

PHPackages © 2026

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