Cakephp 3 Callback method not reached

瘦欲@ 提交于 2019-12-02 07:19:07

As can be seen in the debugging results, $this->StoragecontainerBlockElements is not what you thought it is, it is a so called "auto-table" or "generic table", that is, an instance of \Cake\ORM\Table instead of a concrete subclass thereof.

Your StoragecontainerBlockElementsTable class/file cannot be found/loaded for some reason, hence the fallback to \Cake\ORM\Table. Might be caused by

  • a typo in the filename, classname, or the namespace
  • or the namespace is missing completely (it's not in your question)
  • or the class lives in a plugin, and you didn't used plugin notation for loading it
  • or the file permissions do not allow reading file
  • or the file is missing (not deployed)
  • ...

See also

Try

use Cake\Log\Log;
use Cake\ORM\Table;

class StoragecontainerBlockElementsTable extends Table {

    public function afterDelete($event, $entity, $options){
        Log::debug('Got here');

    }
}

Details Here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!