예제 #1
0
 public function getViewParameters(BlockInterface $block)
 {
     $properties = $block->getProperties();
     $limit = isset($properties['limit']) ? $properties['limit'] : 5;
     $reviews = $this->reviewManager->getRepository()->createQueryBuilder('r')->orderBy('r.createdAt', 'DESC')->setMaxResults($limit)->getQuery()->getResult();
     $parameters = parent::getViewParameters($block);
     $parameters['reviews'] = $reviews;
     return $parameters;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getViewParameters(BlockInterface $block)
 {
     $parameters = parent::getViewParameters($block);
     $reference = null;
     if ($block->getReference()) {
         $service = $this->getReferenceService($block);
         $reference = $block->getReference();
         $service->load($reference);
         $parameters = $service->getViewParameters($reference);
         $parameters['pointer'] = $block;
     }
     return $parameters;
 }
예제 #3
0
 public function getViewParameters(BlockInterface $block)
 {
     $parameters = parent::getViewParameters($block);
     $classes = array('column_classes' => $this->getColumnClasses($block), 'offset_classes' => $this->getOffsetClasses($block), 'gutter_classes' => $this->getGutterClasses($block));
     return array_merge($parameters, $classes);
 }
 public function getViewParameters(BlockInterface $block)
 {
     $parameters = parent::getViewParameters($block);
     return array_merge($parameters, ['form' => $this->form->createView(), 'subscribed' => $this->subscribed]);
 }