[REVERSEFAV] Added reverse favorourites stream/template

This commit is contained in:
Daniel
2020-12-07 16:23:56 +00:00
committed by Hugo Sales
parent 5516a77b33
commit f04923405f
5 changed files with 86 additions and 1 deletions

View File

@@ -139,4 +139,28 @@ END;
'order by f.created DESC', ['id' => $actor_id]),
];
}
/**
* Reverse favourites stream
*
* @param Request $request
*
* @throws \App\Util\Exception\NoLoggedInUser user not logged in
*
* @return array template
*/
public function reversefavs(Request $request)
{
$actor_id = Common::ensureLoggedIn()->getId();
return [
'_template' => 'network/reversefavs.html.twig',
'notes' => DB::dql('select n from App\Entity\Note n, App\Entity\Favourite f ' .
'where n.id = f.note_id ' .
'and f.gsactor_id != :id ' .
'and n.gsactor_id = :id ' .
'order by f.created DESC' ,
['id' => $actor_id]),
];
}
}