public function _cast($name, $data, $options)
    {
        if ($data === null) {
            return;
        }
        if ($data instanceof Document) {
            return $data;
        }

        $class = ltrim($options['class'], '\\');

        $config = [
            'schema'    => $class === Document::class ? $this : null,
            'basePath'  => $options['basePath'],
            'exists'    => $options['exists'],
            'defaults'  => $options['defaults']
        ];
        if (isset($options['config'])){
            $config = Set::extend($config, $options['config']);
        }

        $column = isset($this->_columns[$name]) ? $this->_columns[$name] : [];
        if (!empty($column['format'])) {
            $data = $this->convert('cast', $column['format'], $data, $column, $config);
        }

        return $class::create($data ? $data : [], $config);
    }