Hi! I have a problem updating some values in database... I have the table Tasks and the table Users. Field userId in the table Tasks is foreign key to the table Users. When I try to update a value in this field nothing happens - value does not change:
$task = Tasks::findFirst('id=' . $taskId);
$task->userId = $newUserId;
$task->save();
$updatedTask = Tasks::findFirst('id=' . $task->id);
echo $updatedTask->userId; /*In this point I get old value*/
Then I tried to do it using modelsManager->createQuery() - in this case also nothing happened. Only when I used db->query() then values were updated.
Please explain to me why it happens and how I can address this problem.