handler($model); if($model->save()){ return $model; } } catch (QueryException $exception){ throw new MalformedRequestException('Unable to update the record due to unexpected error'); } } abstract function getModel(Model $model); abstract function handler(Model $model); }