PHPackages                             halumein/yii2-consumption-module - 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. halumein/yii2-consumption-module

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

halumein/yii2-consumption-module
================================

consumption

11002PHP

Since Sep 13Pushed 9y ago3 watchersCompare

[ Source](https://github.com/halumein/yii2-consumption-module)[ Packagist](https://packagist.org/packages/halumein/yii2-consumption-module)[ RSS](/packages/halumein-yii2-consumption-module/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Yii2-consumption-module
=======================

[](#yii2-consumption-module)

```
php composer require halumein/yii2-consumption-module "*"

```

миграции:

```
php yii migrate --migrationPath=vendor/halumein/yii2-consumption-module/migrations

```

В конфигурационный файл приложения добавить модуль consumption

```
    'modules' => [
        'consumption' => [
            'class' => 'halumein\consumption\Module',
        ],
        //...
    ]
```

В конфигурационный файл также

В модуль Order добавить обработку, которая отработает при создании нового заказа

,,,

'modules' =&gt; \[

```
'order' => [

    ...

    'on create' => function($event) {
        $order = $event->model;

        $ident  = $order->id;
        $elements = $order->getElements();

        foreach ($elements as $element) {
            $countPrice = $element->count;
            $price = $element->getModel();
            Yii::$app->transaction->addByPrice($price, $countPrice, $ident);
        }
    }

    ...

]

```

\] ,,,

дальше обращаться по адресу consumption/&lt;имя\_контроллера&gt;

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 51% 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/ca61f99bdb01eb0f458944223a12e55575f73c4ffc6965259e2b96a8bbc26cee?d=identicon)[halumein](/maintainers/halumein)

---

Top Contributors

[![slam-mt](https://avatars.githubusercontent.com/u/20283374?v=4)](https://github.com/slam-mt "slam-mt (25 commits)")[![halumein](https://avatars.githubusercontent.com/u/5361342?v=4)](https://github.com/halumein "halumein (20 commits)")[![pistol88](https://avatars.githubusercontent.com/u/8104605?v=4)](https://github.com/pistol88 "pistol88 (3 commits)")[![PROloggg](https://avatars.githubusercontent.com/u/25814457?v=4)](https://github.com/PROloggg "PROloggg (1 commits)")

### Embed Badge

![Health badge](/badges/halumein-yii2-consumption-module/health.svg)

```
[![Health](https://phpackages.com/badges/halumein-yii2-consumption-module/health.svg)](https://phpackages.com/packages/halumein-yii2-consumption-module)
```

###  Alternatives

[dave-liddament/php-language-extensions

Attributes for extending the PHP language, using static analysis to enforce new language constructs

188526.8k4](/packages/dave-liddament-php-language-extensions)[geocoder-php/here-provider

Geocoder here adapter

121.2M3](/packages/geocoder-php-here-provider)

PHPackages © 2026

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