Source of file TestTextJSONFieldObject.php
Size: 0,898 Bytes - Last Modified: 2021-12-23T10:25:23+00:00
/var/www/docs.ssmods.com/process/src/tests/TestTextJSONFieldObject.php
123456789101112131415161718192021222324252627282930313233343536 | <?php namespace Symbiote\DataChange\Tests; use SilverStripe\ORM\DataObject; use SilverStripe\Dev\TestOnly; use SilverStripe\ORM\FieldType\DBText; use Symbiote\DataChange\Extension\ChangeRecordable; class TestTextJSONFieldObject extends DataObject implements TestOnly { private static $table_name = 'TestTextJSONFieldObject'; private static $db = [ 'TextFieldWithJSON' => DBText::class, ]; private static $extensions = [ ChangeRecordable::class, ]; /** * This is the getter that can cause the DataDifferencer to fall * over. * * This getter pattern was used in at least 1 internal Symbiote project. */ public function getTextFieldWithJSON() { $value = $this->getField('TextFieldWithJSON'); if (is_string($value)) { $value = json_decode($value, true); } return $value; } } |