PHPackages                             sp/fixture-dumper - 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. sp/fixture-dumper

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

sp/fixture-dumper
=================

Dump fixtures from doctrine.

v1.2.0(9y ago)1114.6k15[1 issues](https://github.com/Spea/fixture-dumper/issues)1MITPHPPHP &gt;=5.3.2

Since Dec 28Pushed 9y ago3 watchersCompare

[ Source](https://github.com/Spea/fixture-dumper)[ Packagist](https://packagist.org/packages/sp/fixture-dumper)[ RSS](/packages/sp-fixture-dumper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (11)Versions (8)Used By (1)

Fixture Dumper Extension for Doctrine
=====================================

[](#fixture-dumper-extension-for-doctrine)

This library aims to provide a simple way to dump fixtures for the Doctrine ORM/ODM.

**Note:** This library is still in an early stage.

[![Build Status](https://camo.githubusercontent.com/57804dab432906dd3d3d92a490e2b823cb4bf19065343bebd32add5b151f1b20/68747470733a2f2f7472617669732d63692e6f72672f537065612f666978747572652d64756d7065722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/Spea/fixture-dumper)

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

[](#installation)

This is installable via [Composer](https://getcomposer.org/) as [sp/fixture-dumper](https://packagist.org/packages/sp/fixture-dumper).

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
$manager = ...; // entity or document manager
$registry = new \Sp\FixtureDumper\Converter\Handler\HandlerRegistry();
$registry->addSubscribingHandler(new \Sp\FixtureDumper\Converter\Handler\DateHandler());

// for creating fixtures classes
$generator = new \Sp\FixtureDumper\Generator\ClassFixtureGenerator();

// for creating yml files which can be loaded with the alice fixtures library
$ymlGenerator = new \Sp\FixtureDumper\Generator\Alice\YamlFixtureGenerator();

// for creating array files which can be loaded with the alice fixtures library
$arrayGenerator = new \Sp\FixtureDumper\Generator\Alice\ArrayFixtureGenerator();

$generatorMap = new \PhpCollection\Map(array('class' => $generator, 'yml' => $ymlGenerator, 'array' => $arrayGenerator));
$dumper = new \Sp\FixtureDumper\ORMDumper($manager, $registry, $generatorMap);
// or
$dumper = new \Sp\FixtureDumper\MongoDBDumper($manager, $registry, $generatorMap);
// $dumper->setDumpMultipleFiles(false);

// the second argument specifies the generator type you want to use
$dumper->dump('/your/workspace/src/Acme/DemoBundle/DataFixtures/ORM', 'array');
```

### Exclusion Strategy

[](#exclusion-strategy)

You can implement the interface `ExclusionStrategyInterface` to define the strategy to select the entities to dump.

```
// ...
$dumper = new \Sp\FixtureDumper\ORMDumper($manager, $registry, $generatorMap);

// The entity Post and Comment won't be dumped
$exclusion = new ArrayExclusionStrategy(['Post', 'Acme\DemoBundle\Entity\Comment']);
$dumper->setExclusionStrategy($exclusion);

$dumper->dump(...);
```

#### Options

[](#options)

`AbstractDumper#dump` accepts a third `$options` argument that is an array with the following keys:

- namespace: The namespace for the generated class to use This options is only required when using the ClassFixtureGenerator

License
-------

[](#license)

Released under the MIT License, see LICENSE.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 84% 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 ~242 days

Recently: every ~285 days

Total

7

Last Release

3435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/84ed641aeff9d2a1e53a3db31958edd22768163b5a6f54c8a4d602fb5faab13f?d=identicon)[Spea](/maintainers/Spea)

---

Top Contributors

[![Spea](https://avatars.githubusercontent.com/u/495017?v=4)](https://github.com/Spea "Spea (68 commits)")[![crisei](https://avatars.githubusercontent.com/u/2930052?v=4)](https://github.com/crisei "crisei (4 commits)")[![miguelgf](https://avatars.githubusercontent.com/u/3419188?v=4)](https://github.com/miguelgf "miguelgf (3 commits)")[![dzoudzou](https://avatars.githubusercontent.com/u/2709249?v=4)](https://github.com/dzoudzou "dzoudzou (2 commits)")[![JMSBot](https://avatars.githubusercontent.com/u/1719218?v=4)](https://github.com/JMSBot "JMSBot (1 commits)")[![mgiustiniani](https://avatars.githubusercontent.com/u/1478947?v=4)](https://github.com/mgiustiniani "mgiustiniani (1 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (1 commits)")[![davefx](https://avatars.githubusercontent.com/u/292309?v=4)](https://github.com/davefx "davefx (1 commits)")

---

Tags

Fixturedatabasedoctrinedumper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sp-fixture-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/sp-fixture-dumper/health.svg)](https://phpackages.com/packages/sp-fixture-dumper)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[webonaute/doctrine-fixtures-generator-bundle

Generate Fixture from your existing data in your database. You can specify the Entity name and the IDs you want to import in your fixture.

67184.1k](/packages/webonaute-doctrine-fixtures-generator-bundle)[guikingone/scheduler-bundle

A Symfony bundle that allows to schedule and create repetitive tasks

114217.4k](/packages/guikingone-scheduler-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[jawira/doctrine-diagram-bundle

📐 Symfony Bundle to generate database diagrams

8187.1k2](/packages/jawira-doctrine-diagram-bundle)[hirevoice/neo4jphp-ogm

Doctrine2-style entity mapper for Neo4j graph database

15918.6k1](/packages/hirevoice-neo4jphp-ogm)

PHPackages © 2026

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