Hi all,
I was trying to integrate the Doctrine MongoDB Softdelete Extension to my 
(yet very simple test) application following briefly the instructions on the 
Readme<https://github.com/doctrine/mongodb-odm-softdelete/blob/master/README.markdown>and
 for the configuration on the 
Bundle <https://github.com/doctrine/mongodb-odm-softdelete-bundle>.
I also added the Interface SoftDeleteable on all classes where I need this 
feature.

On the first try, I was going to delete a user from the FOS Bundle by 
calling app.php/user/{username}/delete - unfortunately the user was deleted 
'hard'.. so I took a look inside FOS\UserBundle\Document\UserManager's 
deleteUser() method, where the user is actually removed from the database..

1) First thought was to create an own UserManager inheriting the one's from 
FOS\UserBundle and overwrite the deleteUser() method (basically replace 
remove() with delete() like from the SoftDelete's readme..) don't know if 
this is a good Idea or not.. then I re-read the documentation again and saw 
that it is possible to attach to  some specific events - now I'm wondering 
if

2) I need to attach myself to those events to have a way where all delete 
processes are catched and deleted 'soft'..

3) Before trying to create an own Event attaching to the Doctrine Events I 
wanted a simple example if the SoftDeleting works at all - so I took again 
the example from the readme and created a simple controller doing this: 
http://pastebin.com/RJCqmVmh

Which *did* actually what I was expecting: 
- create country and 
- delete it soft by setting the deletedAt value to the current time.. 
but I had a strange Error on executing: http://pastebin.com/eP8A3Hx5

What's wrong here? Here's my Country Document Class 
http://pastebin.com/QPdgyPvj


4) So I'm wondering, what is the best practice to have a full SoftDeleteable 
behaviour for all Classes that implement SoftDeleteable? Do I need to have 
two DocumentManagers, one for saving, one for deleting soft? From the 
SoftDeleteBundle's 
soft_delete.xml<https://github.com/doctrine/mongodb-odm-softdelete-bundle/blob/master/Doctrine/ODM/MongoDB/Symfony/SoftDeleteBundle/Resources/config/soft_delete.xml>I
 read that it should actually be part of the DocumentManager. Or maybe I 
missunderstand it?

Any advice on how this nice extension is used properly is very appreciated.

Thanks,
Conrad

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to