public static function getCategoryFilterValues($filter, $categoryId) {
        /* @var $class ActiveRecordInterface */

        $class = $filter->type->class_name;
        $objects = $class::find()
            ->joinWith('products p')
            ->where(['p.category_id' => $categoryId])
            ->all();

        return $objects;
    }
public static function getCategoryFilterValues($filter, $categoryId) {
        /* @var $class ActiveRecordInterface */

        $class = $filter->type->class_name;
        $objects = $class::find()
            ->joinWith('products p')
            ->where(['p.category_id' => $categoryId])
            ->all();

        return $objects;
    }
public static function getCategoryFilterValues ( $ filter , $ categoryId ) { /* @var $class ActiveRecordInterface */ $ class = $ filter -> type -> class_name ; $ objects = $ class :: find ( ) -> joinWith ( 'products p' ) -> where ( [ 'p.category_id' => $ categoryId ] ) -> all ( ) ; return $ objects ; }
This method return only these rows which product_id complies existing product.
@param $filter
@param $categoryId
This method return only these rows which product_id complies existing product .