use if instead of switch, to be able to detect objects properly
use if instead of switch, to be able to detect objects properly

midgardproject/midgard-php5,midgardproject/midgard-php5,midgardproject/midgard-php5,midgardproject/midgard-php5