$fieldsToLoad
опираясь на нужность поля клиенту, типа $shits = array_flip($notLoadFields);
$fieldsToLoad = array();
isset($shits['REVIEWS']) or $fieldToLoad['REVIEWS'] = function (){};
isset($shits['QUESTIONS']) or $fieldToLoad['QUESTIONS'] = function (){};
// …
function checkValue(&$item) {
return isset($item) and $item !== '';
};
<?php
$arr = [
'test' => 'test string',
'emptStr'=> '',
'nullValue'=> null
];
function chekValue (&$var){
return isset($var) and $var !== '';
}
var_dump($arr);
var_dump(chekValue($arr['test']));
var_dump(chekValue($arr['emptStr']));
var_dump(chekValue($arr['nullValue']));
var_dump(chekValue($arr['testUndefined']));
var_dump($arr);
array(3) {
["test"]=>
string(11) "test string"
["emptStr"]=>
string(0) ""
["nullValue"]=>
NULL
}
bool(true)
bool(false)
bool(false)
bool(false)
array(4) {
["test"]=>
string(11) "test string"
["emptStr"]=>
string(0) ""
["nullValue"]=>
NULL
["testUndefined"]=>
NULL
}