public function getOrders()
    {
        $orders = Order::find()->joinWith('orderProducts')->where(['product_id' => $this->id])->all();
        return $orders;
    }
public function getOrders()
    {
        $orders = Order::find()->joinWith('orderProducts')->where(['product_id' => $this->id])->all();
        return $orders;
    }
public function getOrders ( ) { $ orders = Order :: find ( ) -> joinWith ( 'orderProducts' ) -> where ( [ 'product_id' => $ this -> id ] ) -> all ( ) ; return $ orders ; }
Gets orders, which have this product
@return \yii\db\ActiveQuery
Gets orders which have this product