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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.