load($params); $this->validate(); $query = Fingerprint::find(); /** @var Card $card */ $card = Card::findOne($this->id_card); if ( !isset($card)){ throw new NotFoundHttpException('Card not found:' . $this->id_card); } $this->card = $card; $customer = Customer::findOne($card->customer); if ( !isset($customer)){ throw new NotFoundHttpException('Customer not found'); } $this->customer = $customer; $query->andWhere(['id_customer' => $customer->id_customer]); return new ActiveDataProvider([ 'query' => $query, ]); } }