This class is used in many places to retreieve collection data from the database.
Ejemplo n.º 1
0
 /**
  * Wrap all fields around the page
  *
  * @param  Page $page
  * @param $pageVersion
  * @return Page
  */
 protected function wrapFieldsAroundPage($page, $pageVersion)
 {
     $language = $this->LanguageDetector->current();
     $globalFields = $this->GlobalField->where('language_id', $language->id)->get();
     $page = $this->wrapTheseFieldsAroundThisPage($globalFields, $page);
     $page = $this->wrapTheseFieldsAroundThisPage($pageVersion->fields, $page);
     $page = $this->wrapTheseCollectionsAroundThisPage($this->CollectionsRepository->findCollectionsForPageVersion($pageVersion), $page);
     return $page;
 }
Ejemplo n.º 2
0
 /**
  * Wrap all fields around the page
  *
  * @param  Page $page
  * @param $pageVersion
  * @return Page
  */
 protected function wrapFieldsAroundPage($page, $pageVersion)
 {
     $language = $this->LanguageDetector->current();
     // loading primary language if language cannot be detected
     $languageId = $language ? $language->id : $this->Config->get('devise.primary_language_id.primary_language_id');
     $globalFields = $this->GlobalField->where('language_id', $languageId)->get();
     $page = $this->wrapTheseFieldsAroundThisPage($globalFields, $page);
     $page = $this->wrapTheseFieldsAroundThisPage($pageVersion->fields, $page);
     $page = $this->wrapTheseCollectionsAroundThisPage($this->CollectionsRepository->findCollectionsForPageVersion($pageVersion), $page);
     return $page;
 }