How do you cross join for an active data provider?

How do you do cross join?

I tried using joinWith on product, but I get an error saying Warehouse model has no relation with Product

Also, I’d like to add that warehouse has no relation with product. I just need them to cross join, is there a proper way to do this?

public function search($params)


        $query = Warehouse::find()->joinWith('product')

                ->select(['product_id' => '','warehouse.warehouse', 'product.category', 'product.product', 'min_stock' => 'coalesce(critical.min_stock, -1)'])

                ->leftJoin('critical', 'critical.product_id = AND critical.warehouse_id =')

				->where(['' => $this->_id]);



        $dataProvider = new ActiveDataProvider([

            'query' => $query,


        if (!$this->validate()) {

            // uncomment the following line if you do not want to return any records when validation fails

            // $query->where('0=1');

            return $dataProvider;



        $query->andFilterWhere(['category' => $this->category]);

        $query->andFilterWhere(['like', 'product', $this->product]);        

        return $dataProvider;


I think the warehouse model needs to have a getProduct() method in order for the joinWith() to work.