B
B
BatteryLow2015-05-06 10:13:26
MySQL
BatteryLow, 2015-05-06 10:13:26

Is it possible to edit incomplete entities in doctrine?

The essence of the question is this: if you select an entity with a limited set of fields using partial , is it even possible to use it for subsequent changes in the database? For example, we select only id while the application is running, we change the value value and run flush (), so that only the value value changes in the database, because the rest of the fields are naturally null.
I anticipate, in principle, a reasonable question, why be so perverted, the application works with big data and quite often, choosing all the fields each time when you often need to edit only one is quite expensive.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
thatside, 2015-05-06
@BatteryLow

If I correctly understand the dock according to the doctrine, then it is impossible. I quote:
from here

S
Sergey, 2015-05-06
Protko @Fesor

I anticipate, in principle, a reasonable question, why be so perverted, the application works with big data and quite often, choosing all the fields each time when you often need to edit only one is quite expensive.

Then it is not clear why you are using Doctrine ORM at all. Do you know what happens with Flush? (unless, of course, you changed the ChangeTrackingPolicy, but then you should also know what is inside the flush)
In general, similar tasks, if you basically do not care about the internal state of your entities, that is, you know perfectly well what you are changing and why - it is better to use DBAL or DQL directly in the repository.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question