PHPackages                             stwarog/uow - 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. [Database &amp; ORM](/categories/database)
4. /
5. stwarog/uow

ActiveLibrary[Database &amp; ORM](/categories/database)

stwarog/uow
===========

Generic Unit of Work pattern implementation for Active Records ORM's. Allows to split technical implementation from domain logic.

2.0.0(4y ago)71.3k[1 issues](https://github.com/stwarog/uow/issues)1MITPHPPHP &gt;=8.0.0

Since Dec 3Pushed 4y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (18)Used By (1)

PHP Unit of Work Layer
======================

[](#php-unit-of-work-layer)

[![Packagist PHP Version Support](https://camo.githubusercontent.com/cb57a5579f34159adcc501d07f30f6c5928e057475e3d09caf5a6dfeb1c48459/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73747761726f672f756f773f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/cb57a5579f34159adcc501d07f30f6c5928e057475e3d09caf5a6dfeb1c48459/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73747761726f672f756f773f7374796c653d666f722d7468652d6261646765)[![GitHub tag (latest by date)](https://camo.githubusercontent.com/e004aa85a3ef72e8056540b3a31afa615f2fd9c30bf031707f806cea02d01cac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73747761726f672f756f773f636f6c6f723d253233376266633033267374796c653d666f722d7468652d6261646765266c6162656c3d76657273696f6e)](https://camo.githubusercontent.com/e004aa85a3ef72e8056540b3a31afa615f2fd9c30bf031707f806cea02d01cac/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f73747761726f672f756f773f636f6c6f723d253233376266633033267374796c653d666f722d7468652d6261646765266c6162656c3d76657273696f6e)

### for ORM's using Active Record Pattern

[](#for-orms-using-active-record-pattern)

This is the core of Framework agnostic package to split complex Active Record pattern logic to some persistence layer, in convenient way. Using this tool you can forget about implementation details as manipulating on relations, saving, detaching etc.

Just keep in mind that you are working on objects!

### Development

[](#development)

This package supports PSR-12 standard. Before each push, run this quality tools command:

```
make check

# or

docker-compose run --rm composer phpcs
docker-compose run --rm composer phpstan
docker-compose run --rm composer unit
```

It will execute Code Sniffer and PhpStan validation rules.

### Config

[](#config)

NameTypeDefaultDescriptionforeign\_key\_checkbooleantrueAllows to globally disable foreign check (not recommended)transactionbooleantrueAllows to globally disable transaction wrapp (not recommended)debugbooleantrueWhen enabled, all queries and debug info are stored### Change Log

[](#change-log)

##### 1.4.1 (2021-01-13)

[](#141-2021-01-13)

- BUGFIX isEmpty in UOW was returning invalid value when only delete added

##### 1.4.0 (2021-07-21)

[](#140-2021-07-21)

- Added no longer new method to PersistAble interface (called in UOW when persisted first time)

##### 1.3.1 (2021-07-10)

[](#131-2021-07-10)

- Config option to disable transaction
- Config option to disable foreign check &amp; debug moved to decorator

##### 1.2.0 (2021-06-09)

[](#120-2021-06-09)

- Dockerized tests for php v7.1
- Make file for easier development
- Static analytics tools: PHPCS and PHPSTAN for ./src directory
- Reformatted code for PSR-12
- Removed MIT license note in every file
- BUG: Added return type in ManyToMany.php
- !! Removed model to in ManyToMany.php
- Usage of Added IterableTrait in AbstractHasManyRelation.php
- Added final to all possible places
- Fixed HasManyTest.php

##### 1.1.1 (2020-01-04)

[](#111-2020-01-04)

- *0abc29e8* removed exception throws on empty uow on flush

##### 1.1.0 (2020-12-28) STABLE

[](#110-2020-12-28-stable)

- *978f8db0* fixed bug with performance in entity manager
- *1ebbf704* removed webmozart/assert

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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 ~26 days

Recently: every ~50 days

Total

17

Last Release

1618d ago

Major Versions

1.4.1 → 2.0.02022-01-27

PHP version history (2 changes)1.0.1-alphaPHP &gt;=7.1

2.0.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5630a890882d4aa41d529e372c96340d27466720d7afb78c8a2f5945987a82f9?d=identicon)[seigba](/maintainers/seigba)

---

Top Contributors

[![serek-dev](https://avatars.githubusercontent.com/u/6751932?v=4)](https://github.com/serek-dev "serek-dev (78 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stwarog-uow/health.svg)

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

###  Alternatives

[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k3.5k](/packages/leantime-leantime)[google/cloud-bigquery

BigQuery Client for PHP

8919.2M53](/packages/google-cloud-bigquery)[patchlevel/event-sourcing

A lightweight but also all-inclusive event sourcing library with a focus on developer experience

207362.9k13](/packages/patchlevel-event-sourcing)[markocupic/calendar-event-booking-bundle

Contao Calendar Event Booking Bundle

135.2k1](/packages/markocupic-calendar-event-booking-bundle)

PHPackages © 2026

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