PhpTek\JSONText\Extension\JSONTextExtension
Synopsis
class JSONTextExtension
extends DataExtension
{
- // methods
- public void __construct()
- public null onBeforeWrite()
- public void updateJSON()
- public void updateCMSFields()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Methods
public
- __construct()
- onBeforeWrite() — Pre-process incoming CMS POST data, and modify any available {@link JSONText} data for presentation in "headless" input fields.
- updateCMSFields() — The CMS input fields declared in the json_field_map static, are not DB-backed, by virtue of this extension, they are backed by specific values represented in the relevant JSON data. Therefore we need to pre-populate each such field's value.
- updateJSON() — Called from {@link $this->onBeforeWrote()}. Inserts or updates each available JSONText DB field with the appropriate input-field data, as per the model's "json_field_map" config static.