Based on the documentation, here is the signature for the method that inserts a new entry or update an existing one.
ee()->api_channel_entries->save_entry($data, $channel_id, $entry_id, $autosave);
My question is that, what should be the contents for $data?
Say for example I have Channel A which has only one custom field, "foo"
Do I do this?
$data = array (
'title' => 'bar',
'url_title' => 'bar'
'foo' => 'bar'
);
or this?
$data = array (
'title' => 'bar',
'url_title' => 'bar'
'field_id_<field id of foo>' => 'bar'
);
Or is the contents of $data
should be something else entirely? Do I need to input required field?