Skip to content

Commit 7f2f2fb

Browse files
Fill doctrine/orm bridge documentation (#141)
* Fill doctrine/orm bridge documentation * Add see also links to doctrine/orm bridge documentation * Add doctrine/orm documentation link * Apply suggestions from code review Co-authored-by: Maximilien Delangle <[email protected]> --------- Co-authored-by: Maximilien Delangle <[email protected]>
1 parent 7acbf42 commit 7f2f2fb

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

docs/docs/bridges/doctrine-orm.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
Bridge with ``doctrine/orm``
22
============================================================
33

4-
todo
4+
Refer to the `official documentation <https://www.doctrine-project.org/projects/orm.html>`__ on Doctrine's website.
5+
56

67
Read from entities in database
78
------------------------------------------------------------
89

9-
todo
10+
The reader will yield each entity of a specified class, one at a time.
11+
12+
.. literalinclude:: doctrine-orm/entity-reader.php
13+
:language: php
14+
15+
.. seealso::
16+
| :doc:`What is an item reader? </core-concepts/item-job/item-reader>`
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use App\Entity\User;
6+
use Doctrine\Persistence\ManagerRegistry;
7+
use Yokai\Batch\Bridge\Doctrine\ORM\EntityReader;
8+
9+
/** @var ManagerRegistry $managerRegistry */
10+
11+
new EntityReader(
12+
doctrine: $managerRegistry,
13+
class: User::class,
14+
);

0 commit comments

Comments
 (0)