src/View/SSViewer_DataPresenter.php
protected function castValue($value, $source)
    {
        // Already cast
        if (is_object($value)) {
            return $value;
        }

        // Get provided or default cast
        $casting = empty($source['casting'])
            ? ViewableData::config()->uninherited('default_cast')
            : $source['casting'];

        return DBField::create_field($casting, $value);
    }
protected function castValue($value, $source)
    {
        // Already cast
        if (is_object($value)) {
            return $value;
        }

        // Get provided or default cast
        $casting = empty($source['casting'])
            ? ViewableData::config()->uninherited('default_cast')
            : $source['casting'];

        return DBField::create_field($casting, $value);
    }
protected function castValue ( $ value , $ source ) { // Already cast if ( is_object ( $ value ) ) { return $ value ; } // Get provided or default cast $ casting = empty ( $ source [ 'casting' ] ) ? ViewableData :: config ( ) -> uninherited ( 'default_cast' ) : $ source [ 'casting' ] ; return DBField :: create_field ( $ casting , $ value ) ; }
Ensure the value is cast safely

@param mixed $value
@param array $source
@return DBField
Ensure the value is cast safely