Why is my data not getting saved into my database?

Hi, i am working on a edit function in my UsersController but the value that i provide will not being updated inside of my database even if the object has got the correct value:

$user->profile->image = $name;

    if ($this->Users->save($user)) {
        $this->Flash->success(__('The user has been saved.'));
        return $this->redirect(['action' => 'index']);
    $this->Flash->error(__('The user could not be saved. Please, try again.'));

APP/Controller/UsersController.php (line 167)
object(App\Model\Entity\User) id:0 {
‘id’ => (int) 22
‘created’ => object(Cake\I18n\FrozenTime) id:1 { }
‘modified’ => object(Cake\I18n\FrozenTime) id:2 { }
‘profile’ => object(App\Model\Entity\Profile) id:3 {
‘id’ => (int) 20
‘user_id’ => (int) 22
‘name’ => ‘Mike’
‘image’ => ‘681668.jpg’

The value ‘image’ of the object is correct here but he does not write it into the database. If I change other values it will work fine. just the value that i write into the object with
$user->profile->image = $name; will not being updated inside of the database.

If you recently added the image column, you need to clear your model cache.

You might also need to $user->setDirty('profile', true) so that the user record knows that there’s an update in the profile that needs to be saved.

okay thank you! now its working…