New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could we implement addBehavior()? #83
Comments
if we can not use behaviors now, is there any workaround? |
Behaviors are a bit tricky. While we could add them, I have concerns that many core and userland behaviors don't make sense in elastic search. For example TreeBehavior, TranslateBehavior make no sense and really have no way of properly functioning. |
@markstory you are right, but in this case there are other plugins like file-upload that need before/after save logic. With no behaviors we must create custom listeners somewhere and add callbacks for Model.before/afterSave I tried to see how behaviorRegistry works, it accepts a Thanks! |
@markstory for example the FriendsOfCake/Search plugin too. |
I don't think it is a good idea. At least using "behaviors" as a word is not a good idea. We could perhaps duplicate the concept with a different name. |
This issue is stale because it has been open for 120 days with no activity. Remove the |
My current use case that seems to call for a behavior is that I have a SQL table and an Elasticsearch index that represent data with the same fields, and I'd like to have them share custom finder methods. I don't think that this can be accomplished well with traits or class inheritance. |
Hello,
it seems that we cannot attach behavior to a type, is this an issue or does it has not been implemented yet?
The text was updated successfully, but these errors were encountered: