update returns true , never update the db field

What is happaning ? I just update a record , without relations and it just doesnt update it but returns true ....

  $loadedModel = $this->model;
    $findModel = $loadedModel::findFirst($this->criteria);   //array("avatar_name = ' asdasdsa' " )

    if (empty($findModel) || !$findModel->update($data)) {     // $findModel->update($data)) is  true
        $this->results = new RepositoryMessages($loadedModel);
    }


10.6k

It could be that $fildModel is empty? Otherwise, use save() instead of update() & see what happens. If you could give more context to your problem I could give a better answer.

Please post more complete code, since we don't know inside the $data and $this->criteria



16.1k
edited Oct '15

Thanks , problem was at the $data array construction :

          $data was array("avatar_name = 'asdasd' ") insted of array("avatar_name " => 'aaaaa')