PHPackages                             heyday/silverstripe-flexibledataformatters - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. heyday/silverstripe-flexibledataformatters

ActiveSilverstripe-module[Utility &amp; Helpers](/categories/utility)

heyday/silverstripe-flexibledataformatters
==========================================

0.3.1(12y ago)39521[1 issues](https://github.com/heyday/silverstripe-flexibledataformatter/issues)[1 PRs](https://github.com/heyday/silverstripe-flexibledataformatter/pulls)PHP

Since Feb 21Pushed 2y ago25 watchersCompare

[ Source](https://github.com/heyday/silverstripe-flexibledataformatter)[ Packagist](https://packagist.org/packages/heyday/silverstripe-flexibledataformatters)[ RSS](/packages/heyday-silverstripe-flexibledataformatters/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (7)Used By (0)

Flexible Data Formatters
========================

[](#flexible-data-formatters)

Provides a way to easily format a selection of a DataObject's fields used in a custom API. This is often useful when creating your own RESTful API that doesn't use SilverStripes `RestfulServer`

For a SilverStripe `2.4` compatible version see the branch `0.2`.

Installation (with composer)
============================

[](#installation-with-composer)

```
$ composer require heyday/silverstripe-flexibledataformatters:~0.1

```

Usage
=====

[](#usage)

```
class MyDataObject extends DataObject implements FlexibleDataFormatterInterface
{
	public static $db = array(
    	'Title' => 'Varchar(255)'
	);

    public function getReadableFields()
    {
        return array(
            'Title'
        );
    }

    public function getDynamicFields()
    {
        return array();
    }
}

$dataObject = new MyDataObject(array('Title' => 'Hello'));
$formatter = new FlexibleJsonDataFormatter();
echo $formatter->convertDataObject($dataObject);

//	Results:
//	{
//		"Title": "Hello"
//	}
```

Unit testing
============

[](#unit-testing)

Install dev dependencies from within module:

```
silverstripe-flexibledataformatters/ $ composer install --dev

```

Use standard `phpunit` command

```
silverstripe-flexibledataformatters/ $ phpunit

```

If you don't have `phpunit` installed globally:

```
silverstripe-flexibledataformatters/ $ vendor/bin/phpunit

```

\##License

Flexible Data Formatters is licensed under an [MIT license](http://heyday.mit-license.org/)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Total

5

Last Release

4696d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de4d8d61f202a03e88c3ed30cce3bfedbc6f56a16e3f3b25546c61aadc51bca2?d=identicon)[heyday](/maintainers/heyday)

---

Top Contributors

[![camspiers](https://avatars.githubusercontent.com/u/51294?v=4)](https://github.com/camspiers "camspiers (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/heyday-silverstripe-flexibledataformatters/health.svg)

```
[![Health](https://phpackages.com/badges/heyday-silverstripe-flexibledataformatters/health.svg)](https://phpackages.com/packages/heyday-silverstripe-flexibledataformatters)
```

###  Alternatives

[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[mautic/core

Mautic Open Source Distribution

9.8k2.6k9](/packages/mautic-core)[mediawiki/maps

Adds various mapping features to MediaWiki

78149.7k3](/packages/mediawiki-maps)[rainlab/blog-plugin

Blog plugin for October CMS

17158.6k](/packages/rainlab-blog-plugin)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

19246.3k2](/packages/civicrm-civicrm-drupal-8)[starcitizentools/citizen-skin

A beautiful, usable, responsive MediaWiki skin with in-depth extension support. Originally developed for the Star Citizen Wiki.

3355.8k](/packages/starcitizentools-citizen-skin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
