- Added utility function var_dump_to_error_log to the fhc_helper

- Added method checkAvailability to model Reihungstest_model
- Added method checkAvailability to library ReihungstestLib
- Added a validation for the test in the method insertPersonReihungstest
of the library ReihungstestLib
This commit is contained in:
Paolo
2017-05-05 11:06:35 +02:00
parent b3c03aaa76
commit d7771da74e
3 changed files with 64 additions and 1 deletions
+23 -1
View File
@@ -23,7 +23,14 @@ class ReihungstestLib
*/
public function insertPersonReihungstest($ddReihungstest)
{
return $this->ci->RtPersonModel->insert($ddReihungstest);
if (isset($ddReihungstest['rt_id']) && $this->checkAvailability($ddReihungstest['rt_id']))
{
return $this->ci->RtPersonModel->insert($ddReihungstest);
}
else
{
return error('This test is not more available');
}
}
/**
@@ -62,4 +69,19 @@ class ReihungstestLib
return $this->ci->ReihungstestModel->loadWhere($parametersArray);
}
/**
* It checks if the test is available
*/
public function checkAvailability($reihungstest_id)
{
$result = $this->ci->ReihungstestModel->checkAvailability($reihungstest_id);
if (hasData($result))
{
return true;
}
return false;
}
}