fix(task) #32 #33 #34 #35 #36 entity_manager option, readers re-executed for each input, table optional with sql, null input errors, lazy hydration - #37
Merged
Conversation
Merged
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #32.
Fixes #33.
Fixes #34.
Fixes #35.
Fixes #36.
Grouped in one PR because the fixes change the same tasks, tests, reference pages and the CHANGELOG
Latestsection (separate PRs would conflict).AbstractDoctrineTask::getEntityManager()(new): the entity manager given by theentity_manageroption (ManagerRegistry::getManager()), or the one managing the class when the option is not set (current behaviour). Used by every EntityManager task (reader, writer, batch writer, cleaner, detacher, refresher, remover).DatabaseReaderTask::next()frees and drops the DBAL result,DoctrineReaderTask::next()drops the iterator, when the iteration ends: the next input executes the query again (it was skipped).DatabaseReaderTask:tableis optional, and only required whensqlis not set (checked on initialization).DoctrineDetacherTaskerror message fixed;DoctrineRemoverTaskthrows a\RuntimeExceptionon anullinput, as the other tasks.DoctrineReaderTaskkeeps thetoIterable()iterator (iterator_to_array()was only added for typing in82fe912): entities are hydrated one at a time.Tests
DatabaseReaderTaskSqliteTest(new):DatabaseReaderTaskon an in-memory SQLite database, iterating as the process manager does. It coverstable,sqlwithouttable, neither of them, three inputs, pagination with two inputs,input_as_params, and anArrayParameterTypeparameter.AbstractDoctrineTaskTest(new): entity manager selection, throughDoctrineWriterTask.DoctrineReaderTaskTest: entities hydrated while iterating, query executed again for each input.54 tests; the new ones fail without the fix (11 errors / failures). The 2 PHPUnit deprecations were already reported on
main.Documentation:
entity_manageroption of every EntityManager task,tableoption, notes of both readers (the "executed once per process run" limitation is removed, memory usage ofDoctrineReaderTask),index.md, export cookbook (no moretableplaceholder withsql).Checked with process-bundle-demo (see the demo PR):
demo.doctrine.database.read_multiple_inputsEmpty resultsetdemo.doctrine.entitymanager.reader_multiple_inputsEmpty resultsetdemo.doctrine.database.read_sql_without_tableThe required option "table" is missing.demo.doctrine.entitymanager.reader_entity_manager(entity_manager: 'unknown')Doctrine ORM Manager named "unknown" does not exist.demo.doctrine.entitymanager.detacher_null_inputDoctrineWriterTask does not allow null inputDoctrineDetacherTask does not allow null inputdemo.doctrine.entitymanager.remover_null_inputget_class(): Argument #1 ($object) must be of type object, null givenDoctrineRemoverTask does not allow null inputdemo.doctrine.database.read,read_paginatedemo.doctrine.database.read_array_parameteralso validates the!php/enum Doctrine\DBAL\ArrayParameterType::…example ofdatabase_reader_task.mdwith DBAL 4.4.Requirements
Breaking changes
entity_manageron an EntityManager task now use that entity manager (the option was ignored); a wrong name now fails.nullinput changes (the task already failed).🤖 Generated with Claude Code