By berdir on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Description:
The mentioned functions where removed from Drupal 8. Developers should use \Drupal::database()->merge(), the Entity API or one of the provided services, like key value.
7.x
$ref_count_record = (object) array(
'count' => $count,
'type' => $type,
'id' => $id,
);
drupal_write_record('example_deleted_entity_statistics', $ref_count_record);
8.x
// Using a merge query in a custom table.
\Drupal::database()->merge('example_deleted_entity_statistics')
->keys(array('type' => $type, 'id' => $id))
->fields(array('count' => $count))
->execute();
// Store the data in a key value collection.
\Drupal::keyValue('example_deleted_entity_statistics')->set($type . '.' . $id, $count);
Impacts:
Module developers