protected function _processDelete(Query $query, array $options = []) {
        $options = $options + [
            'before' => true,
            'after' => true
        ];

        // Fetch ID
        $this->id = $id = $this->findID($query);

        if ($options['before']) {
            $event = $this->emit('db.preDelete', [$query, $id]);
            $state = $event->getState();

            if (!$state) {
                return 0;
            } else if (is_numeric($state)) {
                return (int) $state;
            }
        }

        // Update the connection context and execute the query
        $count = $this->getDriver()
            ->setContext('delete')
            ->executeQuery($query)
            ->save();

        // Only trigger callback if something was deleted
        if ($count && $options['after']) {
            $this->emit('db.postDelete', [$id, $count]);
        }

        return (int) $count;
    }