public function onBeforeDeleteUser(UserEvent $event)
    {
        $user = $event->getUser();

        $locks = $this->entityManager->getRepository('PhlexibleElementBundle:ElementLock')
            ->findBy(['userId' => $user->getId()]);

        foreach ($locks as $lock) {
            $this->entityManager->remove($lock);
        }
    }