/** * Finds the Permission model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $principal_id * @param integer $subordinate_id * @param string $type * @param integer $action * @return Permission the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($principal_id, $subordinate_id, $type, $action) { if (($model = Permission::findOne(['principal_id' => $principal_id, 'subordinate_id' => $subordinate_id, 'type' => $type, 'action' => $action])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Finds the Permission model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Permission the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Permission::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * Finds the Permission model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Permission the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Permission::findOne($id)) !== null) { return $model; } else { return new Permission(); } }