Closed damianoporta closed 4 years ago
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 Table
object on its constructor, if we will implement behaviors...should we modify it or create another one "registry" ?
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 stale
label or comment or this will be closed in 15 days
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?