public function beforeFind(Event $event, Query $query, ArrayObject $options, $primary)
    {
        $query->formatResults(function ($results) use ($options) {
            return $results->map(function ($entity) use ($options) {
                if (!($entity instanceof EntityInterface)) {
                    return $entity;
                }
                foreach ($this->config('columns') as $column) {
                    if ($entity->has($column)) {
                        $eventName = $this->_table->alias() . ".{$column}.defaultValues";
                        $defaultValue = $this->_table->dispatchEvent($eventName, compact('entity'))->result;
                        $currentValue = $entity->get($column);
                        $newValue = $currentValue;

                        if (is_array($currentValue) && is_array($defaultValue)) {
                            $newValue = Hash::merge($defaultValue, $currentValue);
                        } elseif (is_string($currentValue) && $currentValue === '') {
                            $newValue = $defaultValue;
                        } elseif (empty($currentValue) && !empty($defaultValue)) {
                            $newValue = $defaultValue;
                        }

                        $entity->set($column, $newValue);
                        if (!empty($options['flatten']) && is_array($entity->get($column))) {
                            foreach ($entity->get($column) as $key => $value) {
                                $entity->set("{$column}:{$key}", $value);
                            }
                        }
                    }
                }

                return $entity;
            });
        });
    }