Ok found a dirty workaround
This code is running ok
$test = $modx->getObject('modTemplateVarResource', array(
'contentid'=> $id,
'tmplvarid' => '14'
));
if(!test){
return 'run this code';
}else{
return 'running here';
//If getObject Emty this code runs
}
and this one run not fine
$test = $modx->getObject('modTemplateVarResource', array(
'contentid'=> $id,
'tmplvarid' => '14'
));
if(!test){
return 'run this code';
//Only run if getObject not Empty
}
It runs only correct with if...else but that is not ok i think. There was no Problem in modx 2.0.7
Can someone check if i am right or help me to find a clean solution. I don´t want to write an "else" everytime, because i don´t need it.
Thx