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 team :
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
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 jose@gmail.com wrote:
You probably want to use $event-data instead. Also, remember that
listeners get the data as arguments, so if