Merge branch 'feature-25562/PV21_Vertraege_Encryption_Merge'

This commit is contained in:
Werner Masik
2023-03-28 20:12:40 +02:00
parent 279ddddfc8
commit c52cd05436
42 changed files with 3812 additions and 52 deletions
@@ -0,0 +1,53 @@
<?php
trait JSONData {
protected function getJSONData(&$target, &$decoded, $attributeName)
{
if (isset($decoded[$attributeName]))
{
$target = $decoded[$attributeName];
return true;
}
return false;
}
protected function getJSONDataString(&$target, &$decoded, $attributeName)
{
if (isset($decoded[$attributeName]))
{
$target = filter_var($decoded[$attributeName], FILTER_SANITIZE_STRING);
return true;
}
return false;
}
protected function getJSONDataInt(&$target, &$decoded, $attributeName)
{
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_INT))
{
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_INT);
return true;
}
return false;
}
protected function getJSONDataFloat(&$target, &$decoded, $attributeName)
{
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_FLOAT))
{
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_FLOAT);
return true;
}
return false;
}
protected function getJSONDataBool(&$target, &$decoded, $attributeName)
{
if (isset($decoded[$attributeName]) && filter_var($decoded[$attributeName], FILTER_VALIDATE_BOOL))
{
$target = filter_var($decoded[$attributeName], FILTER_VALIDATE_BOOL);
return true;
}
return false;
}
}