createQueryBuilder('o') ->where('o.folder = :folder') ->andWhere('o.userFileOwnerInterface = :user') ->setParameter('folder', $folderItem) ->setParameter('user', $user); return $query->orderBy('o.id', 'ASC') ->getQuery() ->getResult() ; } }