Issue
Whenever a new entity is created, the following error occurs.
Warning (4096): Argument 3 passed to App\Model\Table\AccountsTable::afterSave() must be of the type array, object given, called in D:\Xampp\htdocs\vendor\cakephp\cakephp\src\Event\EventManager.php on line 268 and defined [APP/Model\Table\AccountsTable.php, line 18]
afterSave code inside the model
public function afterSave(Event $event, Entity $entity, array $options) {
}
Anyone have any idea what's going on here?
Solution
I found the answer. Should be CakePHP documentation bug here. Hope it helps someone. Link here: http://book.cakephp.org/3.0/en/orm/table-objects.html#Cake\ORM\Table::afterSave
public function afterSave(Event $event, Entity $entity, $options) {
}
Answered By - Shawn Ang
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.