So when i’m updating channel entries via the API, I keep losing all relationship data.
How can I keep the data?
//$data has array with some new data. never relationship data though
$cd = $this->EE->db->get_where('channel_data', array('field_id_2' => $id));
$cd_res_arr = $cd->result_array();
$entry_id = $cd_res_arr[0]['entry_id'];
$new_entry_data = $cd_res_arr[0];
//MAKE SURE NO OVERWRITING WITH BLANK DATA
foreach($data as $data_field_name => $data_field_value) {
$new_entry_data[$data_field_name] = $data_field_value;
}
$update_success = $this->EE->api_channel_entries->update_entry($entry_id, $new_entry_data);
What extra step do i need to keep relationship data from deleting?
thanks!