/**
  * {@inheritdoc}
  */
 public function getTimeline(ComponentInterface $subject, array $options = array())
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('page' => 1, 'max_per_page' => 10, 'type' => TimelineInterface::TYPE_TIMELINE, 'context' => 'GLOBAL', 'filter' => true, 'paginate' => false));
     $options = $resolver->resolve($options);
     $token = new Pager\PagerToken($this->getRedisKey($subject, $options['context'], $options['type']));
     return $this->resultBuilder->fetchResults($token, $options['page'], $options['max_per_page'], $options['filter'], $options['paginate']);
 }
Пример #2
0
 /**
  * @param array $options pager, filter
  *
  * @return array|object
  */
 public function execute(array $options = array())
 {
     $qb = $this->createQueryBuilder();
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('filter' => true, 'paginate' => false));
     $options = $resolver->resolve($options);
     return $this->resultBuilder->fetchResults($qb, $this->page, $this->maxPerPage, $options['filter'], $options['paginate']);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function getSubjectActions(ComponentInterface $subject, array $options = array())
 {
     $resolver = new OptionsResolver();
     $resolver->setDefaults(array('page' => 1, 'max_per_page' => 10, 'filter' => true, 'paginate' => false));
     $options = $resolver->resolve($options);
     $token = new Pager\PagerToken($this->getSubjectRedisKey($subject));
     return $this->resultBuilder->fetchResults($token, $options['page'], $options['max_per_page'], $options['filter'], $options['paginate']);
 }