Jump to content

Problem with magic methods.


tatebn

Recommended Posts

I have a class that has the __get and __set magic methods defined.  The idea is to use those to communicate with the __get and __set methods in a database table object which is a protected attribute of this class.  Then I can quickly build out models without having to bother with method definitions aside from those that need modifications made to the data before saving.

 

The problem is, they don't seem to be doing anything.  I get an undefined function error the first time I call getVarx().  I don't actually have any of the attributes I'm trying to get and set defined in the object, but I thought that was the point of these magic methods.  Am I missing something here?

 

Thanks,

Brandon

Link to comment
https://forums.phpfreaks.com/topic/226466-problem-with-magic-methods/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.