public function beforeDelete(Event $event, EntityInterface $entity)
    {
        $config = $this->getConfig();
        $this->_ensureFields($entity);
        $left = $entity->get($config['left']);
        $right = $entity->get($config['right']);
        $diff = $right - $left + 1;

        if ($diff > 2) {
            $query = $this->_scope($this->_table->query())
                ->delete()
                ->where(function ($exp) use ($config, $left, $right) {
                    /* @var \Cake\Database\Expression\QueryExpression $exp */
                    return $exp
                        ->gte($config['leftField'], $left + 1)
                        ->lte($config['leftField'], $right - 1);
                });
            $statement = $query->execute();
            $statement->closeCursor();
        }

        $this->_sync($diff, '-', "> {$right}");
    }