Guys.... When I update a row like this, works fine:
$row = Models\Avaliacoes::findFirstById( $id );
$row->assign( $data );
return $row->update();
But when I do like this, doesn't work:
$row = new Models\Avaliacoes();
$row->setId( $id );
$row->assign( $data );
return $row->update();
I got this message:
Array ( [0] => Phalcon\Mvc\Model\Message Object ( [_type:protected] => InvalidUpdateAttempt [_message:protected] => Record cannot be updated because it does not exist [_field:protected] => [_model:protected] => )
)
I really have to find the row before updating a record or there is something wrong going on?
Thanks!