Hello,
I have a function that gets passed xPDO objects of different classes. I looked in the API for something like ->getClass, but it's not there.
Assuming I'm not asking for too much, how can I get the class of a given xPDO object?
Thanks!
PHP illiterate MODx enthusiast
Wow, romain! Thanks a bunch!

Just why didn't I think of general PHP functions??
Oh well...
Have a nice day
PHP illiterate MODx enthusiast
You can access the object class name with $obj->_class that is a string of the class with stripped classname. Eg. if you have modResource_mysql (the actual loaded class) the _class is modResource
Almost retired from web-development industry but still randomly writing at Lazylegs.info and on schedule hopefully in near future to finish Oracle and PostgreSQL ports of MODX
-
☆ A M B ☆
- 571 Posts
aha, cleaner way!
Much thanks mister xPDO Jr. ;--)