Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / system / tests / fixtures / update / drupal-8.entity-test-initial.php
1 <?php
2 // @codingStandardsIgnoreFile
3
4 use Drupal\Core\Database\Database;
5
6 $connection = Database::getConnection();
7
8 // Simulate an entity type that had previously set an initial key schema for a
9 // field.
10 $schema = $connection->select('key_value')
11   ->fields('key_value', ['value'])
12   ->condition('collection', 'entity.storage_schema.sql')
13   ->condition('name', 'entity_test_update.field_schema_data.name')
14   ->execute()
15   ->fetchField();
16
17 $schema = unserialize($schema);
18 $schema['entity_test_update']['fields']['name']['initial'] = 'test';
19
20 $connection->update('key_value')
21   ->fields(['value' => serialize($schema)])
22   ->condition('collection', 'entity.storage_schema.sql')
23   ->condition('name', 'entity_test_update.field_schema_data.name')
24   ->execute();