}
/**
- * Retrieves untagged entries for a user.
+ * Retrieve a sorted list of untagged entries for a user.
*
* @param int $userId
*
public function getBuilderForUntaggedByUser($userId)
{
return $this
- ->getSortedQueryBuilderByUser($userId)
- ->andWhere('size(e.tags) = 0');
+ ->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId));
+ }
+
+ /**
+ * Retrieve untagged entries for a user.
+ *
+ * @param int $userId
+ *
+ * @return QueryBuilder
+ */
+ public function getRawBuilderForUntaggedByUser($userId)
+ {
+ return $this->getQueryBuilderByUser($userId)
+ ->leftJoin('e.tags', 't')
+ ->andWhere('t.id is null');
}
/**