79368455

Date: 2025-01-19 05:20:12
Score: 2
Natty:
Report link

The solution was kindly provided to me in the staging ground mode. I’m sharing it here in case it can help others in the same situation. The challenge was getting the update function to work with a composite key. I had to use a ->set() function with the update() function.

According to the documentation, the first argument to update() should be an id and the second argument should be the data. You seem to be only passing in the data, maybe try with set() instead?

$this->where('currency_id_asked', $_data['currency_id_asked'])
->where('currency_id_inkind', $_data['currency_id_inkind']) ->set([ 'exchange_rate' => 1 / $_data['exchange_rate'], 'source_url_id' => $SU->getSaveUrlIfNotExists($_data['source_url_id']), ])
->update();

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: ADF