public function deleteSubtree(Section $section)
 {
     //Update deleted subtree
     $queryBuilder = $this->_em->createQueryBuilder();
     $queryBuilder->update('Icap\\WikiBundle\\Entity\\Section', 'section')->set('section.left', 0)->set('section.right', 0)->set('section.level', -1)->set('section.parent', '?1')->set('section.deleted', '?2')->set('section.deletionDate', '?3')->andWhere('section.root = :root')->andWhere($queryBuilder->expr()->gte('section.left', $section->getLeft()))->andWhere($queryBuilder->expr()->lte('section.right', $section->getRight()))->setParameter(1, null)->setParameter(2, true)->setParameter(3, new \DateTime('NOW'))->setParameter('root', $section->getRoot());
     $queryBuilder->getQuery()->getSingleScalarResult();
     $boundaryWidth = $section->getRight() - $section->getLeft() + 1;
     //Update boundaries (left and right) for all nodes after deleted node
     $queryBuilder = $this->_em->createQueryBuilder();
     $queryBuilder->update('Icap\\WikiBundle\\Entity\\Section', 'section')->set('section.right', 'section.right-?1')->andWhere('section.root = :root')->andWhere($queryBuilder->expr()->gt('section.right', $section->getRight()))->setParameter(1, $boundaryWidth)->setParameter('root', $section->getRoot());
     $queryBuilder->getQuery()->getSingleScalarResult();
     $queryBuilder = $this->_em->createQueryBuilder();
     $queryBuilder->update('Icap\\WikiBundle\\Entity\\Section', 'section')->set('section.left', 'section.left-?1')->andWhere('section.root = :root')->andWhere($queryBuilder->expr()->gt('section.left', $section->getRight()))->setParameter(1, $boundaryWidth)->setParameter('root', $section->getRoot());
     $queryBuilder->getQuery()->getSingleScalarResult();
 }