Is there are way to get __callStatic, or similar, functionality in PHP 5.2?
I\'m finishing a PHP Framework and need to use this functionality for a Database ORM clas
Not in a static capacity. Technically speaking Rails, CakePHP, etc don't call these types of dynamic methods statically. Not to get in a philosophical debate, but if backward compatibility is a requirement, you could shift your paradigm and use __call()
. In which case you would call with an object like ModelObject->find_by_col2_or_col4
. Of course I understand that's probably not what you wanted to hear.
It's PHP, there's probably some kind of way to hack it, but I don't believe a native method exists.