PHPackages                             derrobert/silverstripe-externaldata - 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. [Database &amp; ORM](/categories/database)
4. /
5. derrobert/silverstripe-externaldata

ActiveSilverstripe-module[Database &amp; ORM](/categories/database)

derrobert/silverstripe-externaldata
===================================

Custom DataObject/ModelAdmin implementation to work with external data sources

0180PHP

Since Oct 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/derRobert/silverstripe-externaldata)[ Packagist](https://packagist.org/packages/derrobert/silverstripe-externaldata)[ RSS](/packages/derrobert-silverstripe-externaldata/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

silverstripe-externaldata
=========================

[](#silverstripe-externaldata)

Custom DataObject/ModelAdmin implementation to work with external data sources

The aim is have an easy way to use ModelAdmin and GridField with data from external datasources.

Just create a Model which extends ExternalDataObject and implement your own `get()`, `write()` and `delete()` methods to work with your custom external data connection. There are some basic examples included for a MongoDB, REST and external MySQL connection.

This module is Work In Process, and some things are likely to change!!!!

\####Things that work :

- Create, Read, Update, Delete
- FormScaffolding
- FieldCasting
- Summary Fields
- FieldLabels
- Limited canView, canEdit checks

\####Things that don't work :

- HasOne, HasMany, ManyMany relations
- SearchFormScaffolding

\##ExternalDataObject This is the base Object you need to extend you Model from. A lot of code is copied from DataObject.php so things like SummaryFields, FormScaffolding and `$form->saveInto()` just works like DataObject. Therefore you still need to add a static `$db` array, like you do for normal DataObjects.

\###Example

```
  class MyExternalDataObject extends ExternalDataObject {

	// you need this to make FormScaffolding work
  	static $db = array(
  		'Title'	=> 'Varchar(255)'
  	);

  	public static function get() {
  		$list = parent::get();

  		// add your code to get a $result of remote records
  		// ExternalDataAdmins GridField will use this list as well to get 1 item from the list
  		foreach($result as $item) {
  			$list->push(new MyExternalDataObject($item));
  		}

  		return $list;
  	}

  	public static function get_by_id($id) {
  		// add your code to get one remote record
  		// This is used in the ExternalDataPage example
  	}

  	public function write() {
  		// add your code to write/update a remote record
  	}

  	public function delete() {
  		// add your code to delete a remote record
  		$this->flushCache();
  		$this->ID = '';
  	}
  }

```

\##ExternalDataAdmin Extends ModelAdmin, but a few custom GridField Components are replaced to make sure the GridField can work with external data. The SearchScaffolder is stripped out, since this is not that easy to implement when you don't know the external datasource and structure.

\##Examples I added some basic examples in the examples folder, which you can also test in frontend with ExternalDataPage. If you just want to use them after downloading, just remove the `_manifest_exclude` file.

Note that **MongoDBExternalDataObject** requires the PHP MongoDB extension :

The **ExternalRestDataObject** requires the RestFullserver module :

This examples just connects local to `Director::absoluteBaseURL() . 'api/v1'` and queries the RestDataObject table

The **ExternalMySQLDataObject** example uses also the RestDataObject table. You need to set the static `$remote_database_config` variable with the correct database credentials.

function getID()
----------------

[](#function-getid)

The ExternalDataObject still requires an ID value for you external records to make CRUD work. Some datasources, like MongoDB, allows an object to be the unique identifier, and an identifier might also be a string. Use this method to convert your external datasource unique identifier to a `$this->ID` value.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/529370?v=4)[derRobert](/maintainers/derRobert)[@derRobert](https://github.com/derRobert)

---

Top Contributors

[![axyr](https://avatars.githubusercontent.com/u/345155?v=4)](https://github.com/axyr "axyr (20 commits)")[![derRobert](https://avatars.githubusercontent.com/u/529370?v=4)](https://github.com/derRobert "derRobert (2 commits)")[![TheBnl](https://avatars.githubusercontent.com/u/1334195?v=4)](https://github.com/TheBnl "TheBnl (1 commits)")

### Embed Badge

![Health badge](/badges/derrobert-silverstripe-externaldata/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)

PHPackages © 2026

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