Skip to content

Instantly share code, notes, and snippets.

@Modicrumb
Last active November 5, 2018 23:07
Show Gist options
  • Save Modicrumb/836c83a5076b1e74b92df528df04707f to your computer and use it in GitHub Desktop.
Save Modicrumb/836c83a5076b1e74b92df528df04707f to your computer and use it in GitHub Desktop.
<?php
class SomeTable extends Table
{
public function implementedEvents()
{
return [
'Model.afterSave' => [
'callable' => 'afterSave',
'priority' => 3
],
];
}
}
@3811015
Copy link

3811015 commented Nov 5, 2018

    public function implementedEvents()
    {
        parent::implementedEvents();
        
        $callback = [$this, 'beforeDelete'];
        $this->getEventManager()->on(
            'Model.beforeDelete',
            ['priority' => 2],
            $callback
        );
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment