We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

how to get the data in afterUpdate method ?

$robot = Robot::findFirst(1);
$data = ['name' => 'Tom'];
$robot->update($data);
Class Robot extends  \Phalcon\Mvc\Model
{
   public function afterUpdate() {
           // how to get the updated data here ?
   }
}

$data = ['name' => 'Tom'];

$data = ['name' => 'Tom', 'color' => 'white'];

the data array may be dynamic, so your method can not solve the problem

$this->name

You should always set and know which columns can be in database as well you should add all properties to make everything working faster.