Jump to content

Variable class function names


flaab

Recommended Posts

Hi =)

 

I have a class that may have a lot of relationships and I would like to do something like this...

 

public function getRelated<classname>(){

          // Whatever logic

}

 

But I want <classname> to be variable...for example getRelatedBooks getRelatedArticles, each class has his own relationships.

 

Can that be done?

 

Thx!

Link to comment
https://forums.phpfreaks.com/topic/75936-variable-class-function-names/
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.