<?php
/******************************************************************************/
//                                                                            //
//                             Smarty plugin                                  //
//                            @package Smarty                                 //
//							 @subpackage plugins                              //
//                        http://life-style.uz/                               //
//                   produced by Life Style, life-style.uz                    //
//                                                                            //
/******************************************************************************/

function smarty_function_fetch_faqs($params, &$smarty){

	$assign        = fetch_getParam('assign', $params, 'faqs');
	$fields        = fetch_getParam('fields', $params, 'faqId, question, answer, status');
	$status        = fetch_getParam('status', $params, 'V');
    $limit         = (int) fetch_getParam('limit', $params);

	if(!empty($limit)) connect()->limit($limit);

	$faqs =  connect()->table('faq')->where('status', $status)->select($fields)->getAll('array');
	$smarty->assign($assign, $faqs);

}