PHPackages                             dhii/cqrs-resource-model-interface - 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. dhii/cqrs-resource-model-interface

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

dhii/cqrs-resource-model-interface
==================================

Interfaces for a CQRS approach to resource models.

v0.2-alpha1(7y ago)02.3k8MITPHPPHP ^5.3 | ^7.0

Since Nov 27Pushed 7y ago3 watchersCompare

[ Source](https://github.com/Dhii/cqrs-resource-model-interface)[ Packagist](https://packagist.org/packages/dhii/cqrs-resource-model-interface)[ RSS](/packages/dhii-cqrs-resource-model-interface/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (5)Used By (8)

Dhii - Storage - CQRS Resource Model - Interface
================================================

[](#dhii---storage---cqrs-resource-model---interface)

[![Build Status](https://camo.githubusercontent.com/9420ffd6cf9b50d061254f7b51c8c24aa11eb5a8a0ff0842ddc3d4962964d080/68747470733a2f2f7472617669732d63692e6f72672f446869692f637172732d7265736f757263652d6d6f64656c2d696e746572666163652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/Dhii/cqrs-resource-model-interface)[![Code Climate](https://camo.githubusercontent.com/f942f1f256c1ce00f29b73767d6926b3c1a4d71df363c58989a7ed6725ec43e8/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f637172732d7265736f757263652d6d6f64656c2d696e746572666163652f6261646765732f6770612e737667)](https://codeclimate.com/github/Dhii/cqrs-resource-model-interface)[![Test Coverage](https://camo.githubusercontent.com/0f826a448e73e86e0fd87779d76d9ee5475dce42f21988f9f1323f5c3ab03826/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f446869692f637172732d7265736f757263652d6d6f64656c2d696e746572666163652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/Dhii/cqrs-resource-model-interface/coverage)[![Latest Stable Version](https://camo.githubusercontent.com/1052f1553cf19074e6f18eb88c82c00d3253d8c353fefdb971abc61e127ef830/68747470733a2f2f706f7365722e707567782e6f72672f646869692f637172732d7265736f757263652d6d6f64656c2d696e746572666163652f76657273696f6e)](https://packagist.org/packages/dhii/cqrs-resource-model-interface)[![This package complies with Dhii standards](https://camo.githubusercontent.com/44bbe8c7678c1784cfc53cabce5d3e32fc22a840453c5ed9c08601522fe7c213/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446869692d436f6d706c69616e742d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Dhii/dhii)

Details
-------

[](#details)

Interfaces for a [CQRS](https://martinfowler.com/bliki/CQRS.html) approach to resource models.

### Interfaces

[](#interfaces)

- [`SelectCapableInterface`](src/SelectCapableInterface.php) - Interface for objects that can retrieve records from storage, optionally limiting the result to only records that satisfy a given condition represented as an arbitrary tree of [expressions](https://packagist.org/packages/dhii/expression-interface).
- [`InsertCapableInterface`](src/InsertCapableInterface.php) - Interface for objects that can insert one or more records into storage. Various container types are supported.
- [`UpdateCapableInterface`](src/UpdateCapableInterface.php) - Interface for objects that can update records in storage, optionally limited to records that satisfy a given condition represented as an arbitrary tree of [expressions](https://packagist.org/packages/dhii/expression-interface).
- [`DeleteCapableInterface`](src/DeleteCapableInterface.php) - Interface for objects that can delete records from storage, optionally limited to records that satisfy a given condition represented as an arbitrary tree of [expressions](https://packagist.org/packages/dhii/expression-interface).

Usage
-----

[](#usage)

```
use Dhii\Storage\Resource\SelectCapableInterface;
use Dhii\Collection\MapInterface;

/* @var $select SelectCapableInterface */
$results = $select->select();

/* The below would go through each element of the result set, and,
 * if the 'age' field is greater than 18, output all of the names
 * and values of all fields.
 */
foreach ($results as $_result) {
  /* @var $_result MapInterface */
  if ((int) $_result->get('age') < 18) {
    continue;
  }

  foreach ($_result as $_field => $_value) {
    echo sprintf('%1$s: %2$s', $_field, $_value) . "\n";
  }

  echo "---' . "\n";
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.6% 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 ~61 days

Total

3

Last Release

2875d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1894e91b32c9f80d8f30a42d360af6983a507f1cf2c621b7c9a0a0de14e011c5?d=identicon)[XedinUnknown](/maintainers/XedinUnknown)

---

Top Contributors

[![mecha](https://avatars.githubusercontent.com/u/5425482?v=4)](https://github.com/mecha "mecha (39 commits)")[![XedinUnknown](https://avatars.githubusercontent.com/u/1428973?v=4)](https://github.com/XedinUnknown "XedinUnknown (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dhii-cqrs-resource-model-interface/health.svg)

```
[![Health](https://phpackages.com/badges/dhii-cqrs-resource-model-interface/health.svg)](https://phpackages.com/packages/dhii-cqrs-resource-model-interface)
```

###  Alternatives

[shipmonk/name-collision-detector

Simple tool to find ambiguous classes or any other name duplicates within your project.

362.1M34](/packages/shipmonk-name-collision-detector)[bostondv/bootstrap-ninja-forms

Adds Bootstrap classes to Ninja Forms

222.2k](/packages/bostondv-bootstrap-ninja-forms)

PHPackages © 2026

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