private function reorderAfterRemove($relatedArticles, $removedRelatedArticlePosition)
{
$this->initOrderOnRelatedArticles($relatedArticles);
try {
$this->em->getConnection()->exec('LOCK TABLES context_articles WRITE;');
// move all bigger than old position up (-1)
$this->em->createQuery('UPDATE Newscoop\\Entity\\RelatedArticle r SET r.order = r.order-1 WHERE r.order > :oldPosition')->setParameter('oldPosition', $removedRelatedArticlePosition)->execute();
$this->em->getConnection()->exec('UNLOCK TABLES;');
} catch (\Exception $e) {
$this->em->getConnection()->exec('UNLOCK TABLES;');
}
return true;
}