PHPackages                             api-skeletons/zf-doctrine-orm-data-validation - 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. api-skeletons/zf-doctrine-orm-data-validation

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

api-skeletons/zf-doctrine-orm-data-validation
=============================================

Validate foreign key relationships in data

1.0.2(10y ago)38471PHP

Since Mar 31Pushed 8y ago2 watchersCompare

[ Source](https://github.com/API-Skeletons/zf-doctrine-orm-data-validation)[ Packagist](https://packagist.org/packages/api-skeletons/zf-doctrine-orm-data-validation)[ RSS](/packages/api-skeletons-zf-doctrine-orm-data-validation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Doctrine ORM Data Validation
============================

[](#doctrine-orm-data-validation)

[![Gitter](https://camo.githubusercontent.com/c45f0485e89d3cd41f666d7d4bb5875cb59836555e05b6b11f77ed223eb64c0c/68747470733a2f2f6261646765732e6769747465722e696d2f6170692d736b656c65746f6e732f6f70656e2d736f757263652e737667)](https://gitter.im/api-skeletons/open-source)[![Total Downloads](https://camo.githubusercontent.com/b3d7dd0b0746a79bd51d81b2d26a017317c9ff1a533466fcf1e98ce443f0d785/68747470733a2f2f706f7365722e707567782e6f72672f6170692d736b656c65746f6e732f7a662d646f637472696e652d6f726d2d646174612d76616c69646174696f6e2f646f776e6c6f616473)](https://packagist.org/packages/api-skeletons/zf-doctrine-orm-data-validation)

For one reason or another you will build an ORM on top of an existing database. The existing database may not have referential integrity for all it's relationships.

You now have a database with an ORM and there is probably bad data in the database which does not conform to the relationships defined in the ORM.

This tool is intended for devleopment only.

Foreign Key Validation
----------------------

[](#foreign-key-validation)

Create a report by scanning every relationship defined in your ORM for data which is missing it's foreign key. Nullable relationships are not evaluated.

```
php index.php orm:data-validation:relationship --object-manager="doctrine.entitymanager.orm_default"
```

This will output TSV with the Count, Distinct Values, Child Field, Child Entity, Parent Entity, and the SQL to duplicate the results for all relationships where data is found in the child which references data not found in the parent.

Configure Zend Framework 2 Module
---------------------------------

[](#configure-zend-framework-2-module)

```
composer require "api-skeletons/zf-doctrine-orm-data-validation": "^1.0"
```

Add to `config/development.config.php.dist`:

```
return array(
    'modules' => array(
        'ZF\\Doctrine\\ORM\\DataValidation'
        ...
    ),
```

Enable development mode to copy `development.config.php.dist` to `development.config.php`

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

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

Total

5

Last Release

3690d ago

Major Versions

0.0.2 → 1.0.02016-04-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/49dd7d9dba889ac674b0da447d9c1e69d1128dc3ccbaef98ba83d6ee519fc2d6?d=identicon)[tom\_anderson](/maintainers/tom_anderson)

---

Top Contributors

[![TomHAnderson](https://avatars.githubusercontent.com/u/493920?v=4)](https://github.com/TomHAnderson "TomHAnderson (2 commits)")

---

Tags

databaseexisting-databaseorm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/api-skeletons-zf-doctrine-orm-data-validation/health.svg)

```
[![Health](https://phpackages.com/badges/api-skeletons-zf-doctrine-orm-data-validation/health.svg)](https://phpackages.com/packages/api-skeletons-zf-doctrine-orm-data-validation)
```

###  Alternatives

[zf-commons/zfc-user-doctrine-orm

Doctrine2 ORM storage adapter for ZfcUser.

85676.8k18](/packages/zf-commons-zfc-user-doctrine-orm)[hounddog/doctrine-data-fixture-module

Zend Framework 2 Module that provides Doctrine Data-Fixture functionality

37335.4k9](/packages/hounddog-doctrine-data-fixture-module)[tawfekov/zf2entityaudit

EntityAudit Module for Zend Framework2 , Doctrine2 and web interface

1910.4k](/packages/tawfekov-zf2entityaudit)

PHPackages © 2026

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