Backdrop now has a consistent way of performing all CRUD functions for entities, as well as accessing entity properties such as label, revision, id, etc.
This applies to:
Taxonomy Term (and Vocabulary) entities
User
Node
File
Example implementation:
Create a Node entity:
$node = entity_create('node', array(
'uid' => 1,
'type' => 'post',
'title' => 'Test node',
'status' => 1,
'comment' => 2,
'promote' => 0,
'sticky' => 0,
'langcode' => LANGUAGE_NONE,
'created' => REQUEST_TIME,
'changed' => REQUEST_TIME,
));
$node->save();
$nid = $node->nid;
Calls to node_save()
have been replaced in core with $node->save()
(although node_save()
continues to exist as a wrapper).
Introduced in branch:
1.0.x
Introduced in version:
1.0.0
Impacts:
Module developers
Theme developers
Related Github Issues: