Given example an empty value of array like:
Model_x Object ( [_is_new:protected] => [_frozen:protected] => [_data:protected] => Array ( [track_value] => ) )
When processed the array and $value = $x->track_value
if($value == 1){ $returnValue = "Automatic"; }else if($value == 0){ $returnValue = "Manuals"; }else{ $returnValue = "Undefined"; }
Output value will be always “Manuals”.
To fix this issue, add “” into the “1″ or “0″
What do you think?