class MyEntity extends \CodeIgniter\Entity\Entity { public function setAttributes($data) { $this->fill($data)->syncOriginal(); }}