Re: CakePHP 3.0 - Get data from event subject

2014-08-26 Thread Dr. Tarique Sani
Thanks $event->data does the trick, $entity as second argument does not appear with Id hydrated. Cheers Tarique On Tue, Aug 26, 2014 at 6:08 PM, José Lorenzo wrote: > You probably want to use $event->data instead. Also, remember that > listeners get the data as arguments, so if you want the en

Re: CakePHP 3.0 - Get data from event subject

2014-08-26 Thread José Lorenzo
You probably want to use $event->data instead. Also, remember that listeners get the data as arguments, so if you want the entity Id add the $entity as the second argument of the function. On Tuesday, August 26, 2014 2:00:49 PM UTC+2, Dr. Tarique Sani wrote: > > Trying something very simple here

CakePHP 3.0 - Get data from event subject

2014-08-26 Thread Dr. Tarique Sani
Trying something very simple here In my Listener I am trying to get $event->subject()->id but I keep getting Table "App\Model\Table\PostsTable" is not associated with "id" What am I missing here? Tarique -- = Hire a CakePHP dev te