Ejemplo n.º 1
0
 /**
  * load data from container.
  *
  * @param SmartContentContainer $container
  * @param PropertyInterface     $property
  * @param PropertyParameter[]   $params
  *
  * @return array|\Sulu\Component\Content\Compat\StructureInterface[]
  */
 private function loadData(SmartContentContainer $container, PropertyInterface $property, $params)
 {
     if (isset($params['max_per_page'])) {
         // determine current page
         $container->setPage($this->getCurrentPage($params['page_parameter']->getValue()));
         $contentData = $this->getPagedContentData($container, $container->getPage(), intval($params['max_per_page']->getValue()), $property->getStructure()->getUuid());
     } else {
         // set default values
         $container->setPage(1);
         $container->setHasNextPage(false);
         $contentData = $this->getNotPagedContentData($container, $property->getStructure()->getUuid());
     }
     return $contentData;
 }