public function __invoke(Request $request, $id) { list($resourceType) = $this->extractAttributes($request); $systemNotice = $this->getItem($this->dataProvider, $resourceType, $id); /* * @var $systemNotice SystemNotice */ $systemNotice->setAcknowledged(); $this->entityManager->flush(); return $systemNotice; }