Frontend\Modules\Faq\Engine\Model::getCategoryById PHP Method

getCategoryById() public static method

Get a category by id
public static getCategoryById ( integer $id ) : array
$id integer
return array
    public static function getCategoryById($id)
    {
        return (array) FrontendModel::getContainer()->get('database')->getRecord('SELECT i.*, m.url
             FROM faq_categories AS i
             INNER JOIN meta AS m ON i.meta_id = m.id
             WHERE i.id = ? AND i.language = ?
             ORDER BY i.sequence', array((int) $id, LANGUAGE));
    }

Usage Example

Beispiel #1
0
 /**
  * Parse
  */
 private function parse()
 {
     $this->tpl->assign('widgetFaqCategory', FrontendFaqModel::getCategoryById($this->data['id']));
     $this->tpl->assign('widgetFaqCategoryList', FrontendFaqModel::getAllForCategory($this->data['id'], $this->get('fork.settings')->get('Faq', 'most_read_num_items', 10)));
 }