2

I want a simple snippet which will look at an object and determine if this is a valid Varien object (rather than a standard PHP object).

eg.

 if ( this is a varien_object )
     do this..
 else
     do something else
Zabs
  • 13,852
  • 45
  • 173
  • 297

1 Answers1

5

use PHP instanceof operator

if ($this instanceof Varien_Object )
 do this..
Lukas Kral
  • 987
  • 13
  • 22