public function convert($mode, $type, $data, $column = [], $options = [])
    {
        $formatter = null;
        $type = $data === null ? 'null' : $type;
        if (isset($this->_formatters[$mode][$type])) {
            $formatter = $this->_formatters[$mode][$type];
        } elseif (isset($this->_formatters[$mode]['_default_'])) {
            $formatter = $this->_formatters[$mode]['_default_'];
        }
        return $formatter ? $formatter($data, $column, $options) : $data;
    }
public function convert($mode, $type, $data, $column = [], $options = [])
    {
        $formatter = null;
        $type = $data === null ? 'null' : $type;
        if (isset($this->_formatters[$mode][$type])) {
            $formatter = $this->_formatters[$mode][$type];
        } elseif (isset($this->_formatters[$mode]['_default_'])) {
            $formatter = $this->_formatters[$mode]['_default_'];
        }
        return $formatter ? $formatter($data, $column, $options) : $data;
    }
public function convert ( $ mode , $ type , $ data , $ column = [ ] , $ options = [ ] ) { $ formatter = null ; $ type = $ data === null ? 'null' : $ type ; if ( isset ( $ this -> _formatters [ $ mode ] [ $ type ] ) ) { $ formatter = $ this -> _formatters [ $ mode ] [ $ type ] ; } elseif ( isset ( $ this -> _formatters [ $ mode ] [ '_default_' ] ) ) { $ formatter = $ this -> _formatters [ $ mode ] [ '_default_' ] ; } return $ formatter ? $ formatter ( $ data , $ column , $ options ) : $ data ; }
Formats a value according to its type.

@param  string $mode    The format mode (i.e. `'cast'` or `'datasource'`).
@param  string $type    The field name.
@param  mixed  $data    The value to format.
@param  array  $column  The column options to pass the the formatter handler.
@param  array  $options The options to pass the the formatter handler (for `'cast'` mode only).
@return mixed           The formated value.
Formats a value according to its type .