Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Application\UserBundle\Controller;
- use Symfony\Bundle\FrameworkBundle\Controller\Controller;
- class HelloController extends Controller
- {
- public function indexAction($name)
- {
- $country = new \Application\LocationBundle\Document\Country();
- $country->setName($name);
- $dm = $this->get('doctrine.odm.mongodb.document_manager');
- $sdm = $this->get('doctrine.odm.mongodb.soft_delete.manager');
- // save country with document manager
- $dm->persist($country);
- $dm->flush();
- // delete country with soft delete manager
- $sdm->delete($country);
- $sdm->flush();
- return $this->render('ApplicationUserBundle:Hello:index.html.twig', array('name' => $name));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment