*/
public function addEntryAction(Request $request)
{
- $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User');
- $user = $repository->find(1);
- $entry = new Entry($user);
+ $entry = new Entry($this->getUser());
$form = $this->createFormBuilder($entry)
->add('url', 'url')
*/
public function showUnreadAction()
{
- $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
- // TODO don't give the user ID like this
// TODO change pagination
- $entries = $repository->findUnreadByUser(1, 0);
+ $entries = $this->getDoctrine()
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findUnreadByUser($this->getUser()->getId(), 0);
return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig',
*/
public function showArchiveAction()
{
- $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
- // TODO don't give the user ID like this
// TODO change pagination
- $entries = $repository->findArchiveByUser(1, 0);
+ $entries = $this->getDoctrine()
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findArchiveByUser($this->getUser()->getId(), 0);
return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig',
*/
public function showStarredAction()
{
- $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
- // TODO don't give the user ID like this
// TODO change pagination
- $entries = $repository->findStarredByUser(1, 0);
+ $entries = $this->getDoctrine()
+ ->getRepository('WallabagCoreBundle:Entry')
+ ->findStarredByUser($this->getUser()->getId(), 0);
return $this->render(
'WallabagCoreBundle:Entry:entries.html.twig',