# |
Jul 19th 2017, 20:47 |
inoas |
https://gist.github.com/inoas/5d71c67f1714fc941a3e93bb408d1b7a#gistcomment-2152306 here are the other abstract classes for the options building |
# |
Jul 19th 2017, 20:47 |
inoas |
I am not much into beer but I am also open to donate a few to you :) |
# |
Jul 19th 2017, 20:46 |
inoas |
no money for beer? :/ |
# |
Jul 19th 2017, 20:46 |
jeremyharris |
Inoas honestly what? |
# |
Jul 19th 2017, 20:46 |
jeremyharris |
That would make me just as happy |
# |
Jul 19th 2017, 20:46 |
jeremyharris |
Gutts donate to the cake project instead :) |
# |
Jul 19th 2017, 20:45 |
jeremyharris |
Inoas the options still come in as an array right? Then just converted to arrayaccess |
# |
Jul 19th 2017, 20:44 |
gutts |
jeremyharris: do you have an app where i could get you a beer? i owe you one.. or a couple |
# |
Jul 19th 2017, 20:44 |
inoas |
honestly jeremy? |
# |
Jul 19th 2017, 20:44 |
gutts |
admad: so just specify it twice will do it? |
# |
Jul 19th 2017, 20:44 |
jeremyharris |
No money for beer lately :( stupid lack of income |
# |
Jul 19th 2017, 20:43 |
admad |
then i dont know :P |
# |
Jul 19th 2017, 20:43 |
jeremyharris |
Unfortunately |
# |
Jul 19th 2017, 20:43 |
admad |
are you sober? |
# |
Jul 19th 2017, 20:43 |
jeremyharris |
I feel like my messages are getting dropped sometimes |
# |
Jul 19th 2017, 20:42 |
gutts |
oh yeah? |
# |
Jul 19th 2017, 20:42 |
admad |
gutts: you can have multiple listeners for an event and also set priorities for listeners |
# |
Jul 19th 2017, 20:42 |
inoas |
but you do not have to |
# |
Jul 19th 2017, 20:42 |
inoas |
so you CAN create all the setter functions for IDE magic |
# |
Jul 19th 2017, 20:41 |
inoas |
and __call() |
# |
Jul 19th 2017, 20:41 |
inoas |
so jeremyharris what I did is working with ArrayAccess and builder-type setters (aka without the setter word) |
# |
Jul 19th 2017, 20:40 |
gutts |
would that be the cake way? |
# |
Jul 19th 2017, 20:40 |
gutts |
i was goign to just define function afterSaveNewStuff(Event $event, Entity $entity) and do $this->importStuff($event, $entity); and $this->somethingElse($event, $entity); |
# |
Jul 19th 2017, 20:39 |
gutts |
example: implementedEvents = ['Model.afterSaveNew' => 'importStuff'] , but I want to call something else in addition to importStuff and keep importStuff pure |
# |
Jul 19th 2017, 20:39 |
jeremyharris |
Gutts wouldn't you have another listener for the second function's logic? |
# |
Jul 19th 2017, 20:38 |
gutts |
versus specifying it a 2nd time? (guessing it only fires once) |
# |
Jul 19th 2017, 20:38 |
gutts |
if i have a listener and for a specific event, bind it to a function... if i want 2 functions to fire should i just create a master function to call them both? |
# |
Jul 19th 2017, 20:37 |
jeremyharris |
That was fast :) yeah that's looking like the right track. You can also look at the ConsoleOptionParser for inspiration, it does similar logic |
# |
Jul 19th 2017, 20:34 |
inoas |
obviously the lines I marked need to be more of a declarative schema validator |
# |
Jul 19th 2017, 20:34 |
inoas |
https://gist.github.com/inoas/5d71c67f1714fc941a3e93bb408d1b7a#file-options-validator-php-L41-L58 |
# |
Jul 19th 2017, 20:34 |
inoas |
so this is the stuff I has been tinkering with |
# |
Jul 19th 2017, 20:33 |
inoas |
heh |
# |
Jul 19th 2017, 20:28 |
jeremyharris |
Decided to take the day off :) |
# |
Jul 19th 2017, 20:27 |
inoas |
jeremyharris still around/awake ;)? |
# |
Jul 19th 2017, 19:48 |
mikesmoniker |
If your duplicate rule can be backed with a UNIQUE index in the DB then at least even if Cake does miss it in validation the BD will reject it. |
# |
Jul 19th 2017, 19:45 |
birdy247 |
just wondered if you had ever seen it before |
# |
Jul 19th 2017, 19:45 |
birdy247 |
will look into it |
# |
Jul 19th 2017, 19:45 |
birdy247 |
yea, just amazed the app rule doesnt stop the 2nd transaction |
# |
Jul 19th 2017, 19:44 |
dereuromark |
hmm, maybe thats the issue? but shouldnt be, you would have to debug and find out why |
# |
Jul 19th 2017, 19:44 |
birdy247 |
maybe a very small overlap |
# |
Jul 19th 2017, 19:44 |
dereuromark |
no, it cant |