/** * @param UpdateTask $command */ public function handle(UpdateTask $command) { $oldTask = $this->tasksRepository->findOne(['id' => $command->id]); $oldTask->updateWithCommand($command); $this->tasksRepository->update($oldTask); // throw update event }