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


function smarty_function_fetch_brand($params, &$smarty){

	$assign        = fetch_getParam('assign', $params, 'brand');
	$fields        = fetch_getParam('fields', $params, 'brandId, publishedOn, name, fileName, url, content, countryId, orderBy');
	$status        = fetch_getParam('status', $params, 'V');
    $fileName      = fetch_getParam('fileName', $params, NULL);

	/* conditions */
    if(!empty($status)) connect()->where('status', $status);

	$brand = connect()->table('brands')->select($fields)->where('fileName', $fileName)->get('array');
    $brand = prepareBrand($brand);

	$smarty->assign($assign, $brand);

	
	return null;
}

?>