0

Maybe some one know. I want to use citusdb and I try to rewrite doctrine updates. If I use standard update for entity For example

$order = $repository->find(1);
$human->setComment("test");
$entityManager->flush();

This code create query Updates ordersSETcomment = "test" WHERE id = 1;

For sharding in citusdb I choosed used_id field. This field exist in all tables.

I need to receive Updates ordersSETcomment = "test" WHERE id = 1 and user_id = 5;

I tried to add

$order = $repository->find(1);
$human->setComment("test");
$human->setUserId(5);
$entityManager->flush();

But if user_id not change doctrine remove this field from sql.

I read about preUpdate, prePost events in doctrine, maybe this can help to resolve my task. But I don't know how=(

David
  • 3
  • 3

0 Answers0