PHPackages                             krajcik/data-builder-doctrine - 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. krajcik/data-builder-doctrine

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

krajcik/data-builder-doctrine
=============================

Doctrine data generator based on database structure of your project.

v1.0.2(1y ago)010.2k↓34.4%BSD-3-ClausePHPPHP &gt;=8.0CI passing

Since Aug 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/krajcikondra/data-builder-doctrine)[ Packagist](https://packagist.org/packages/krajcik/data-builder-doctrine)[ RSS](/packages/krajcik-data-builder-doctrine/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (15)Used By (0)

krajcik/data-builder-doctrine
=============================

[](#krajcikdata-builder-doctrine)

Package helps to write test data for tests using data builders which package generate specifically for your project. By default, are all data filled randomly with option change one or more properties.

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

[](#installation)

```
composer require krajcik/data-builder-doctrine

```

Using
-----

[](#using)

### Configuration and generate

[](#configuration-and-generate)

```
use Doctrine\ORM\EntityManagerInterface;
use Krajcik\DataBuilderDoctrine\BuilderCompiler;
use Krajcik\DataBuilderDoctrine\Dto\Configuration;

// load your application
$app = require __DIR__ . '/../public/index.php';
$em = $app->getService(EntityManagerInterface::class); // entty manager from your project

$targetFolder = __DIR__ . '/Builder/Generated';
$configuration = new Configuration(
    $targetFolder,
    namespace: 'Tests\Builder\Generated',
    customBuilderFolder: __DIR__ . '/Builder/CustomBuilder',
);

```

### Generate builders

[](#generate-builders)

```
    use \Krajcik\DataBuilder\BuilderCompiler;

    $compiler = new BuilderCompiler($em, $configuration);
    $compiler->compile();

```

### Using generated builders in your code

[](#using-generated-builders-in-your-code)

```
    $builderFactory = new \Tests\Generated\Builder\BuilderFactory($entityManager);

    $contactData = $builderFactory->createContactDataBuilder()
        ->withFirstName('John')
        ->withLastName('Doe')
        ->buildAndSave();
    // $contactData is saved doctrine entity (Api\Contact\Entity\ContactData) from your project which you can use now in your test case

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance45

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~35 days

Total

14

Last Release

425d ago

Major Versions

v0.1.10 → v1.0.02024-11-01

### Community

Maintainers

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

---

Top Contributors

[![ondrejkrajcik-blogic](https://avatars.githubusercontent.com/u/150679625?v=4)](https://github.com/ondrejkrajcik-blogic "ondrejkrajcik-blogic (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/krajcik-data-builder-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/krajcik-data-builder-doctrine/health.svg)](https://phpackages.com/packages/krajcik-data-builder-doctrine)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58723.9M36](/packages/scienta-doctrine-json-functions)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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