taskGroupRepository->find($id); if (null === $group) { throw new InvalidArgumentException(sprintf('TaskGroup with ID %d not found.', $id)); } if (null !== $title) { $group->setTitle($title); } if (null !== $description) { $group->setDescription($description); } if (null !== $color) { $group->setColor($color); } if (null !== $archived) { $group->setArchived($archived); } $this->entityManager->flush(); return json_encode(Serializer::groupFull($group)); } }