protected function deleteHooks($module)
    {
        $query = ModuleHookQuery::create();
        if (null !== $module) {
            $query
                ->filterByModule($module)
                ->delete();
        } else {
            $query->deleteAll();
        }

        $query = IgnoredModuleHookQuery::create();
        if (null !== $module) {
            $query
                ->filterByModule($module)
                ->delete();
        } else {
            $query->deleteAll();
        }
    }