\ExternalDataObject
ExternalDataObject
Use this class to create an object from an external datasource with CRUD options and that will work with the GridField.
In this way you can connect to other datasources and manage them with the build in Modeladmin.
This is basicly a stripped down DataObject, without being tied to a Database Table,
and works more or less the same.
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
SearchScaffolding.
To provide a flexible way to work with External Data, you have to create your own get(), get_one(), delete()
functions in your subclass, since we can not know what kind of data you work with.
Important is that you provide a method that set an ID value as an unique identifier
This can be any value and is not limited to an integer.
Synopsis
- // members
- public static array $db = ;
- private $changed;
- protected $record;
- private static $singular_name = NULL;
- private static $plural_name = NULL;
- private static $summary_fields = NULL;
- protected static array $_cache_db = ;
- protected static $_cache_get_one;
- protected static array $_cache_field_labels = ;
- protected static array $_cache_composite_fields = ;
- // methods
- public void __construct()
- public static void is_composite_field()
- private static void cache_composite_fields()
- public void __get()
- public void __set()
- public static void get()
- public void getID()
- public void getTitle()
- public void getCMSFields()
- public void getFrontEndFields()
- public void scaffoldFormFields()
- public void db()
- public void dbObject()
- public void fieldLabels()
- public void hasField()
- public void setField()
- public void setCastedField()
- public void getField()
- public void fieldLabel()
- public void singular_name()
- public void i18n_singular_name()
- public void plural_name()
- public void i18n_plural_name()
- public void getDefaultSearchContext()
- public void canCreate()
- public void canView()
- public void canEdit()
- public void canDelete()
- public void extendedCan()
- public void summaryFields()
- public void flushCache()
Hierarchy
Members
private
- $changed
- $plural_name
- $singular_name
- $summary_fields
protected
- $_cache_composite_fields
- $_cache_db
- $_cache_field_labels
- $_cache_get_one
- $record
public
- $db
Methods
private
public
- __construct()
- __get()
- __set()
- canCreate()
- canDelete()
- canEdit()
- canView()
- db()
- dbObject()
- extendedCan()
- fieldLabel()
- fieldLabels()
- flushCache()
- get() — Child classes should call $list = parent::get();
- getCMSFields()
- getDefaultSearchContext()
- getField()
- getFrontEndFields()
- getID()
- getTitle()
- hasField()
- i18n_plural_name()
- i18n_singular_name()
- is_composite_field()
- plural_name()
- scaffoldFormFields()
- setCastedField()
- setField()
- singular_name()
- summaryFields()