PHPackages                             plumphp/plum-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. plumphp/plum-doctrine

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

plumphp/plum-doctrine
=====================

PlumDoctrine integrates Doctrine into Plum. Plum is a data processing pipeline for PHP.

v0.1(10y ago)119MITPHP

Since Oct 23Pushed 10y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

 [![Plum](https://camo.githubusercontent.com/a81342cbfd6f64a484988488ad37bbd0e665d0f14f65ec655ae986097447bfb6/687474703a2f2f63646e2e666c6f7269616e2e65632f706c756d2d6c6f676f2e737667)](https://camo.githubusercontent.com/a81342cbfd6f64a484988488ad37bbd0e665d0f14f65ec655ae986097447bfb6/687474703a2f2f63646e2e666c6f7269616e2e65632f706c756d2d6c6f676f2e737667)
==================================================================================================================================================================================================================================================================================================================================================================

[](#----)

> PlumDate integrates Doctrine into Plum. Plum is a data processing pipeline for PHP.

[![Build Status](https://camo.githubusercontent.com/f25df55a440cee8d0850969c64b7e991207baf5ae26ff7427019ef520f553593/68747470733a2f2f7472617669732d63692e6f72672f706c756d7068702f706c756d2d646f637472696e652e737667)](https://travis-ci.org/plumphp/plum-doctrine)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/14cec5186501e96a5d95b192ca2a2f2d8398b14b55ea13ea4931d7ec1d82215f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706c756d7068702f706c756d2d646f637472696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/plumphp/plum-doctrine/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/d422e0aa3789a31f877cbff1bb7b2551f6e518e5cb06ddba7668736a4bd769de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706c756d7068702f706c756d2d646f637472696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/plumphp/plum-doctrine/?branch=master)[![StyleCI](https://camo.githubusercontent.com/c68e3f3b39189cc8b440f65bd93b4d48c535f14075c72fc183e8671ddbc2a090/68747470733a2f2f7374796c6563692e696f2f7265706f732f34343830333539382f736869656c64)](https://styleci.io/repos/44803598)

Developed by [Florian Eckerstorfer](https://florian.ec) in Vienna, Europe.

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

[](#installation)

You can install PlumDoctrine using [Composer](http://getcomposer.org).

```
$ composer require plumphp/plum-doctrine
```

Usage
-----

[](#usage)

Please refer to the [Plum documentation](https://github.com/plumphp/plum/blob/master/docs/index.md) for more information.

**Doctrine ORM**

- [`EntityWriter`](#entitywriter-for-doctrine-rom)
- [`QueryReader`](#queryreader-for-doctrine-orm)
- [`RepositoryReader`](#repositoryreader-for-doctrine-orm)

### `EntityWriter` for Doctrine ORM

[](#entitywriter-for-doctrine-orm)

`Plum\PlumDoctrine\ORM\EntityWriter` persists entities using an instance of `Doctrine\ORM\EntityManagerInterface`. It supports batch operations with a configurable flush interval.

```
use Plum\PlumDoctrine\ORM\EntityWriter;

$writer = new EntityWriter($entityManager);
$writer->prepare();
$writer->writeItem($user1); // persist, but no flush
$writer->writeItem($user2); // persist, but no flush
$writer->finish(); // flush
```

If you are persisting too many entities for one flush at the end you can set the `flushInterval` option to flush after writing every `x` entities.

```
use Plum\PlumDoctrine\ORM\EntityWriter;

$writer = new EntityWriter($entityManager, ['flushInterval' => 3);
$writer->prepare();
$writer->writeItem($user1); // persist, but no flush
$writer->writeItem($user2); // persist, but no flush
$writer->writeItem($user3); // persist and flush
$writer->writeItem($user4); // persist, but no flush
$writer->finish(); // flush
```

Setting the `flushInverval` option to `null`, which is also the default value, flushes the transaction only when calling `finish()`. If no items are written using `writeItem()` the writer will never call `flush()`.

### `QueryReader` for Doctrine ORM

[](#queryreader-for-doctrine-orm)

`Plum\PlumDoctrine\ORM\QueryReader` takes an instance of `Doctrine\ORM\AbstractQuery` and returns an iterator for the result.

```
use Plum\PlumDoctrine\ORM\QueryReader;

$reader = new QueryReader($query);
$reader->getIterator(); // -> ArrayIterator
$reader->count(); // -> int
```

The hydration mode can be set using the `hydrationMode` option.

```
use Plum\PlumDoctrine\ORM\QueryReader;

$reader = new QueryReader($query, ['hydrationMode' => Doctrine\ORM\Query::HYDRATE_ARRAY);
$reader->getIterator(); // -> ArrayIterator
```

### `RepositoryReader` for Doctrine ORM

[](#repositoryreader-for-doctrine-orm)

`Plum\PlumDoctrine\ORM\RepositoryReader` takes a `Doctrine\ORM\EntityRepository` and a [simple condition](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-objects.html#by-simple-conditions)and returns an iterator with the results.

```
use Plum\PlumDoctrine\ORM\RepositoryReader;

$reader = new RepositoryReader($repository, ['age' => 20]);
$reader->getIterator(); // -> ArrayIterator
$reader->count(); // -> int
```

Change Log
----------

[](#change-log)

### Version 0.1 (24 October 2015)

[](#version-01-24-october-2015)

- Initial release

License
-------

[](#license)

The MIT license applies to plumphp/plum-doctrine. For the full copyright and license information, please view the LICENSE file distributed with this source code.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

2

Last Release

3906d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/plumphp-plum-doctrine/health.svg)

```
[![Health](https://phpackages.com/badges/plumphp-plum-doctrine/health.svg)](https://phpackages.com/packages/plumphp-plum-doctrine)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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