public function convert(Model $model, $data, $mode) {
        if (empty($data[$model->alias])) {
            return $data;
        }

        foreach ($data[$model->alias] as $key => $value) {
            if (isset($this->settings[$model->alias][$key])) {
                $converter = $this->settings[$model->alias][$key];

                if (method_exists($model, $converter['engine'])) {
                    $function = array($model, $converter['engine']);
                } else if (method_exists($this, $converter['engine'])) {
                    $function = array($this, $converter['engine']);
                }

                if (isset($function)) {
                    if (is_array($value) && $converter['flatten']) {
                        $value = (string) $value;
                    }

                    $data[$model->alias][$key] = call_user_func_array($function, array($value, $converter, $mode));
                }
            }
        }

        return $data;
    }