// Create a "Llama" comment.
$comment = Comment::
create([ 'comment_body' =>
[ 'value' => 'The name "llama" was adopted by European settlers from native Peruvians.',
'format' => 'plain_text',
],
'entity_id' =>
$commented_entity->
id(),
'entity_type' => 'entity_test',
'field_name' => 'comment',
]);
$comment->
setSubject('Llama'
) ->
setOwnerId(static::
$auth ?
$this->account->
id() : 0
) ->
setPublished() ->
setCreatedTime(123456789
) ->
setChangedTime(123456789
);
$comment->
save();
return $comment;
} /**
* {@inheritdoc}
*/