You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have recently faced very strange error when trying to update my documents with 1.0.0-beta6 version. The common code for all my trials is as follows:
$dm = $this->get('doctrine_mongodb.odm.default_document_manager');
$session = $dm->getRepository('BrowserSession')->find($this->get('session')->getId());
$session->incrementRequests();
// Continues with one of the code snippets below
If I try to call $dm->persist($session); $dm->flush(); an exception "Undefined index: requests in Doctrine/ODM/MongoDB/UnitOfWork.php line 736" is thrown.
$dm->flush($session); works properly.
$dm->flush(); does not do anything.
I am slightly confused what's going on. Previously, code snippet 1 has worked properly.
The document:
/**
* @MongoDB\Document()
* @MongoDB\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
*/
class BrowserSession
{
// ID and other fields are here
/**
* @MongoDB\Increment
* @var integer
*/
protected $requests = 0;
public function incrementRequests() { $this->requests++; }
}
The text was updated successfully, but these errors were encountered:
Hi,
I have recently faced very strange error when trying to update my documents with 1.0.0-beta6 version. The common code for all my trials is as follows:
If I try to call
$dm->persist($session); $dm->flush();
an exception "Undefined index: requests in Doctrine/ODM/MongoDB/UnitOfWork.php line 736" is thrown.$dm->flush($session);
works properly.$dm->flush();
does not do anything.I am slightly confused what's going on. Previously, code snippet 1 has worked properly.
The document:
The text was updated successfully, but these errors were encountered: