getRelated() public static method

Get related items based on tags
public static getRelated ( integer $id, integer $limit = 5 ) : array
$id integer
$limit integer
return array
Beispiel #1
0
 /**
  * Parse the data into the template
  */
 private function parse()
 {
     // add to breadcrumb
     if ($this->settings['allow_multiple_categories']) {
         $this->breadcrumb->addElement($this->record['category_title'], $this->record['category_full_url']);
     }
     $this->breadcrumb->addElement($this->record['question']);
     // set meta
     if ($this->settings['allow_multiple_categories']) {
         $this->header->setPageTitle($this->record['category_title']);
     }
     $this->header->setPageTitle($this->record['question']);
     // assign article
     $this->tpl->assign('item', $this->record);
     // assign items in the same category and related items
     $this->tpl->assign('inSameCategory', FrontendFaqModel::getAllForCategory($this->record['category_id'], $this->settings['related_num_items'], $this->record['id']));
     $this->tpl->assign('related', FrontendFaqModel::getRelated($this->record['id'], $this->settings['related_num_items']));
     // assign settings
     $this->tpl->assign('settings', $this->settings);
     // parse the form
     if (empty($this->status)) {
         $this->frm->parse($this->tpl);
     }
     // parse the form status
     if (!empty($this->status)) {
         $this->tpl->assign($this->status, true);
     }
 }