Hi all
I have some functionality in my AppModel that I'd like to publish as a
plugin or so, so I can re-use the code in other projects.
So far it looks like this:
class AppModel extends Model {
function readRandom() {}
}
Now one possibility is to extract my functionality into a class that
will be put between AppModel and Model:
class BetterModel extends Model {
function readRandom() {}
}
class AppModel extends BetterModel {
}
But this isn't very flexible be cause I'm constructing a fixed
inheritance chain this way. In every project I'd have to put this
manually into my AppModel - when only having one such feature-rich
model this isn't a big problem, but what when I have several more
feature-rich models? AppModelWithFunctionality,
AppModelWithMoreFunctionality, AppModelWithEvenMoreFunctionality etc.?
Then the inheritance chain gets really awkward and isn't flexible
anymore when differently combining those functionalities in different
projects.
So is there a solution for this? With behaviors one can create awesome
functionality that is run automatically, but I don't see that they
would help me in solving my problem...? Or do I miss something?
Thanks a lot
Josh
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en