/** * @return int */ public function countCouples() { $tours = $this->getTours()->all(); $ids = []; foreach ($tours as $t) { $ids[] = $t->id; } $size = Couple::find()->where(['tour_id' => $ids])->count(); return $size; }
/** * Lists all Couple models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => Couple::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }