private function findReceipt($hash) { $model = Receipt::findByHash($hash); if (!$model) { throw new NotFoundHttpException(); } return $model; }
/** * @return \yii\db\ActiveQuery */ public function getReceipt() { return $this->hasOne(\common\models\Receipt::className(), ['id' => 'receipt_id']); }