PartKeepr\CoreBundle\Action\SystemNoticeAcknowledgeAction::__invoke PHP Method

__invoke() public method

Sets the acknowledged flag for a system notice.
public __invoke ( Request $request, integer $id ) : array | Dunglas\ApiBundle\Model\PaginatorInterface | Traversable
$request Symfony\Component\HttpFoundation\Request The request
$id integer The ID of the system notice
return array | Dunglas\ApiBundle\Model\PaginatorInterface | Traversable
    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;
    }
SystemNoticeAcknowledgeAction