getConfig() public method

Get config.
public getConfig ( ) : Config
return Wallabag\CoreBundle\Entity\Config
Beispiel #1
0
 /**
  * Global method to retrieve entries depending on the given type
  * It returns the response to be send.
  *
  * @param string $type Entries type: unread, starred or archive
  * @param User   $user
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 private function showEntries($type, User $user)
 {
     $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
     switch ($type) {
         case 'starred':
             $qb = $repository->getBuilderForStarredByUser($user->getId());
             break;
         case 'archive':
             $qb = $repository->getBuilderForArchiveByUser($user->getId());
             break;
         case 'unread':
             $qb = $repository->getBuilderForUnreadByUser($user->getId());
             break;
         default:
             throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
     }
     $pagerAdapter = new DoctrineORMAdapter($qb->getQuery());
     $entries = new Pagerfanta($pagerAdapter);
     $perPage = $user->getConfig()->getRssLimit() ?: $this->getParameter('wallabag_core.rss_limit');
     $entries->setMaxPerPage($perPage);
     return $this->render('@WallabagCore/themes/common/Entry/entries.xml.twig', ['type' => $type, 'entries' => $entries]);
 }
Beispiel #2
0
 /**
  * Retrieves the tagging rules for a given user.
  *
  * @param User $user
  *
  * @return array<TaggingRule>
  */
 private function getRulesForUser(User $user)
 {
     return $user->getConfig()->getTaggingRules();
 }