const interceptor = FetchInterceptor.register({
onBeforeRequest(request, controller) {
// Hook before request
},
onRequestSuccess(response, request, controller) {
// Hook on response success
},
onRequestFailure(response, request, controller) {
// Hook on response failure
}
});
// Make fetch requests to see interceptor in action
fetch('http://whatever.com/whatever');
countries
id - integer
name - string
users
id - integer
country_id - integer
name - string
posts
id - integer
user_id - integer
title - string
doctor
id - integer
name - string
client_course
id - integer
course_id - integer
doctor_id - integer
client_id. - integer
client
id - integer
name - string
namespace BasicMethod;
calculatePerspective($company) {
return $company['param1'] / ($company['param7']) - $company['param4']);
}
calculateStability($company) {
return $company['param8'] * ($company['param1']);
}
calculateAutonomy($company) {
return $company['param8'] * ($company['param1']);
}
// соответствие
conformityPerspective($score, $company) {
// тут проверяем, сколько лет фирме и какой балл соответствует переданному $score, вычисленному через calculatePerspective();
}
conformityStability($score, $company) {
// то же, что и выше для стабильности
}
conformityAutonomy($score, $company) {
// то же, что и выше для автономности
}
function perspective($company) {
$score = calculatePerspective($company);
return conformityPerspective($score, $company);
}
function stability($company) {
$score = calculateAutonomy($company);
return conformityAutonomy($score, $company);
}
function autonomy($company) {
$score = calculateAutonomy($company);
return conformityAutonomy($score, $company);
}
$basicMethod = [
"perspective",
"stability",
"autonomy"
];
$company = Company::all();
foreach ($basicMethod as $coefficient) {
$scores += call_user_func("BasicMethod\\".$coefficient, $company);
}
echo $scores;