->setParameter('userId', $userId)
->execute();
}
+
+ /**
+ * Find all annotations related to archived entries.
+ *
+ * @param $userId
+ *
+ * @return mixed
+ */
+ public function findAllArchivedEntriesByUser($userId)
+ {
+ return $this->createQueryBuilder('a')
+ ->leftJoin('a.entry', 'e')
+ ->where('a.user = :userid')->setParameter(':userid', $userId)
+ ->andWhere('e.isArchived = true')
+ ->getQuery()
+ ->getResult();
+ }
}