# |
May 26th 2016, 09:13 |
birdy247 |
sorry, my bad |
# |
May 26th 2016, 09:13 |
neon1024 |
I'm in a mental muddle because my machine keeps crashing, I'm trying to do updates, upgrade php, talk on here and also update php storm |
# |
May 26th 2016, 09:12 |
neon1024 |
Would be how I'd think it works |
# |
May 26th 2016, 09:12 |
neon1024 |
$event->result // array('foo' => 123) |
# |
May 26th 2016, 09:12 |
birdy247 |
but the book talks about using the result |
# |
May 26th 2016, 09:12 |
neon1024 |
$event->data = ['foo' => $bar]; |
# |
May 26th 2016, 09:12 |
neon1024 |
Yeah $event->result != $event->data |
# |
May 26th 2016, 09:09 |
birdy247 |
after I dispatch, debug($event->data['timetable']); null |
# |
May 26th 2016, 09:08 |
rawroland |
Just learnt something new at Cakefest2016: cowsay |
# |
May 26th 2016, 09:08 |
birdy247 |
return $event; |
# |
May 26th 2016, 09:08 |
birdy247 |
$event->data['timetable'] = "123" |
# |
May 26th 2016, 09:08 |
birdy247 |
in my listener |
# |
May 26th 2016, 09:06 |
birdy247 |
@neon1024: I cant seem to get anything from $event->result |
# |
May 26th 2016, 09:03 |
neon1024 |
I don't know / didn't look to see if there was an irc equivalent |
# |
May 26th 2016, 09:03 |
neon1024 |
The cool kids here are doing advanced workshops in the #cakefest channel in slack |
# |
May 26th 2016, 09:03 |
neon1024 |
Well I have an account through php south coast conference green room from when I was speaking |
# |
May 26th 2016, 09:03 |
birdy247 |
what do you think |
# |
May 26th 2016, 09:03 |
birdy247 |
@neon1024: why the use of slack :slightly_smiling_face: |
# |
May 26th 2016, 09:00 |
birdy247 |
I will try |
# |
May 26th 2016, 09:00 |
birdy247 |
or perhaps $result = $event; return $result |
# |
May 26th 2016, 09:00 |
birdy247 |
or do I need to return $event |
# |
May 26th 2016, 08:59 |
birdy247 |
$event->result['timetable'] = $entities; $event->result['placement'] = $placement; return true; |
# |
May 26th 2016, 08:59 |
neon1024 |
For mine in Proffer it can return a whole array of configuration |
# |
May 26th 2016, 08:59 |
neon1024 |
If the event is processing a string, you might want to return the modified string |
# |
May 26th 2016, 08:58 |
neon1024 |
Well you can return whatever you want from the event |
# |
May 26th 2016, 08:58 |
neon1024 |
// Using the event result public function place($order) |
# |
May 26th 2016, 08:58 |
birdy247 |
but it doesnt make it clear what you should return |
# |
May 26th 2016, 08:58 |
birdy247 |
the 2nd code snippet is the one right? |
# |
May 26th 2016, 08:58 |
birdy247 |
I was reading that |
# |
May 26th 2016, 08:57 |
neon1024 |
Ahh yes $event->result |
# |
May 26th 2016, 08:57 |
neon1024 |
This one, http://book.cakephp.org/3.0/en/core-libraries/events.html#getting-event-results |
# |
May 26th 2016, 08:56 |
neon1024 |
Then the event handler needs to return as well obviously |
# |
May 26th 2016, 08:56 |
neon1024 |
This is how I've thrown my event, and I would have $result = ..etc ->dispatch() |
# |
May 26th 2016, 08:56 |
neon1024 |
https://github.com/davidyell/CakePHP3-Proffer/blob/master/src/Model/Behavior/ProfferBehavior.php#L119-L121 |
# |
May 26th 2016, 08:55 |
neon1024 |
Let me check I'm sure it was in the book |
# |
May 26th 2016, 08:55 |
birdy247 |
and morning back ;) |
# |
May 26th 2016, 08:55 |
neon1024 |
Heya ankr |
# |
May 26th 2016, 08:55 |
birdy247 |
will try that |
# |
May 26th 2016, 08:55 |
birdy247 |
ok, cool |
# |
May 26th 2016, 08:55 |
ankr |
and morning |
# |
May 26th 2016, 08:55 |
ankr |
y |