When I create a node like this:
$nodeSetup = [
'nid' => NULL,
'type' => $bundle,
'uid' => $uid,
'revision' => 0,
'status' => 1,
'body' => ['format' => 'full_html', 'value' => Xss::filter($body)],
];
$_node = Node::create($nodeSetup);
the body value and format work fine. But, when I load an existing node, how can I set the body value keeping the format? This didnt work:
$_node->body->format = 'full_html';
$_node->body->set('format', 'full_html');
$_node->save();