/**
* Remove all entries for a user id.
- * Used when a user want to reset all informations
+ * Used when a user want to reset all informations.
*
- * @param int $userId
+ * @param int $userId
*/
public function removeAllByUserId($userId)
{
$this->getEntityManager()
- ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = '.$userId)
+ ->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.user = :userId')
+ ->setParameter('userId', $userId)
->execute();
}
}