Q
Q
Qwyu_4iLofK2022-04-13 20:06:43
Doctrine ORM
Qwyu_4iLofK, 2022-04-13 20:06:43

Why does simultaneous saving of entities on the same page not work?

Can you please tell
me why saving entities in one repository function does not work (sometimes it works, sometimes it doesn't)?
I'm in pain and I don't understand why.

class OrdersRepository(){
            public function fff()
                {
                    $positions = $this->positionsOrdersRepository->getPositions($date, $step);
                    foreach ($positions as $position) {
                        if (...){
                            $position->setTitle(3);
                            $this->positionsOrdersRepository->setSave();

                            $position->getOrder()->setTitl("0");
                            $this->setSave();
                        }
            
            }
            
            }
    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question