$brands = $this->brands->get_brands(array('category_id'=>$filter['category_id']));
$category->brands = $brands;
//Есть ли активный бренд в фильтре
if(!empty($filter['brand_id'])){
$brands_active = true;
$count_prefix = '+';
}else{
$count_prefix = '';
}
foreach($category->brands as &$brand_temp){
if(isset($brands_active)){
if(in_array($brand_temp->id, $filter['brand_id'])){
$brand_temp->checked = true;
$brand_temp->disabled = false;
$brand_temp->count = 0;
} else {
$brand_temp->checked = false;
$brand_temp->disabled = false;
$temp_filter = $filter;
$temp_filter['brand_id'] = (array)$brand_temp->id;
$brand_temp->count = $count_prefix.$this->products->count_products($temp_filter);
unset($temp_filter);
if((int)$brand_temp->count > 0){
$brand_temp->disabled = false;
}else{
$brand_temp->disabled = true;
$brand_temp->count = 0;
}
}
}else{
$brand_temp->checked = false;
$brand_temp->disabled = false;
$temp_filter = $filter;
$temp_filter['brand_id'] = (array)$brand_temp->id;
$brand_temp->count = $count_prefix.$this->products->count_products($temp_filter);
unset($temp_filter);
if((int)$brand_temp->count > 0)
$brand_temp->disabled = false;
else
$brand_temp->disabled = true;
}
}
Ругается на выделенную строку
if(in_array($brand_temp->id, $filter['brand_id'])){
Warning: in_array() expects parameter 2 to be array, string given in