# |
Sep 30th 2016, 14:43 |
birdy247 |
$event->stopPropogation() |
# |
Sep 30th 2016, 14:42 |
Neon1024 |
Thatâ??s like saying you canâ??t drive your car because youâ??ve taken the wheels off |
# |
Sep 30th 2016, 14:42 |
Neon1024 |
If youâ??ve removed the event if uses, then no, it won't |
# |
Sep 30th 2016, 14:42 |
birdy247 |
when using this behaviour |
# |
Sep 30th 2016, 14:42 |
birdy247 |
but what doesnt seems to happen is the cascadeCallbacks |
# |
Sep 30th 2016, 14:42 |
birdy247 |
I have achieved that no probs |
# |
Sep 30th 2016, 14:42 |
birdy247 |
Ah |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
Then I guess just roll your own |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
Just configure it to not use the beforeDdelete event |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
Answer is right there in the behaviour |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
There you go |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
https://github.com/UseMuffin/Trash/blob/master/src/Model/Behavior/TrashBehavior.php#L33-L40 |
# |
Sep 30th 2016, 14:41 |
Neon1024 |
Hah |
# |
Sep 30th 2016, 14:40 |
Neon1024 |
Might be time for you to PR the plugin! |
# |
Sep 30th 2016, 14:40 |
Neon1024 |
Yeah, not too sure, Iâ??d probably try those two things and see which thing worked, if it was me doing it personally |
# |
Sep 30th 2016, 14:39 |
Neon1024 |
Or perhaps bind an event listener with a higher priority? |
# |
Sep 30th 2016, 14:39 |
Neon1024 |
Perhaps setup your own callback method inside the table class? |
# |
Sep 30th 2016, 14:39 |
Neon1024 |
Not too sure |
# |
Sep 30th 2016, 14:39 |
birdy247 |
And this is my before delete |
# |
Sep 30th 2016, 14:39 |
Neon1024 |
Er |
# |
Sep 30th 2016, 14:38 |
birdy247 |
I set it up as per the docs |
# |
Sep 30th 2016, 14:38 |
birdy247 |
How do I run my own beforeDelete? |
# |
Sep 30th 2016, 14:37 |
birdy247 |
Neon1024 |
# |
Sep 30th 2016, 14:36 |
Neon1024 |
I donâ??t own it, itâ??s the communities code :D |
# |
Sep 30th 2016, 14:36 |
Neon1024 |
No, not â??myâ?? code, â??theâ?? code |
# |
Sep 30th 2016, 14:36 |
Neon1024 |
Not sure my code is clever enough to trash stuff it doesnâ??t know about :p |
# |
Sep 30th 2016, 14:35 |
Neon1024 |
https://github.com/UseMuffin/Trash/pull/12/files#diff-142591c35e3af31a6932558fbff20f26R325 |
# |
Sep 30th 2016, 14:35 |
birdy247 |
oh no |
# |
Sep 30th 2016, 14:35 |
birdy247 |
I need business logic in the beforeDelete |
# |
Sep 30th 2016, 14:35 |
Neon1024 |
So have you attached the Trash behaviour to Timetables? |
# |
Sep 30th 2016, 14:35 |
birdy247 |
but I am only using the beforeFind event |
# |
Sep 30th 2016, 14:34 |
birdy247 |
yes |
# |
Sep 30th 2016, 14:34 |
Neon1024 |
So youâ??ve attached the behaviour to Placements |
# |
Sep 30th 2016, 14:34 |
birdy247 |
:) |
# |
Sep 30th 2016, 14:34 |
birdy247 |
yes |
# |
Sep 30th 2016, 14:34 |
Neon1024 |
Ok, with you :) |
# |
Sep 30th 2016, 14:34 |
Neon1024 |
Placements hasMany Timetables, and Timetables belongsTo Placements |
# |
Sep 30th 2016, 14:33 |
birdy247 |
timetables has a placement_id |
# |
Sep 30th 2016, 14:33 |
Neon1024 |
So that means timetables.placement_id right? |
# |
Sep 30th 2016, 14:33 |
birdy247 |
when a placement is deleted, I want to soft delete the placement, and run beforeDelete on each timetable |
# |
Sep 30th 2016, 14:32 |
birdy247 |
So a placement hasMany timetables |