Thursday, 15 August 2013

flush() doesn't work in Doctrine 2

flush() doesn't work in Doctrine 2

I'm new in Doctrine 2. I have a big problem on beginning, I didn't find
any solution in Google. I want to keep tree in DB. I found a NestedSet
plugin (https://github.com/blt04/doctrine2-nestedset). I downloaded it,
and I tried to build tree. I tried this way (it's the same like in the
documentation):
$config = new \DoctrineExtensions\NestedSet\Config($entityManager,
'src\File');
$nsm = new \DoctrineExtensions\NestedSet\Manager($config);
$mainFolder = new \src\File();
$mainFolder->setName('Folder 1');
$nsm->createRoot($mainFolder);
But it does nothing. I looked iside createRoot() function, and I figured
out that function flush() doesen't work:
$this->getEntityManager()->flush()
But I don't know why. It doesen't throw an Exception, and returns nothing.
Any ideas?

No comments:

Post a Comment