Ddd\Infrastructure\Application\Notification\DoctrinePublishedMessageTracker::trackMostRecentPublishedMessage PHP Метод

trackMostRecentPublishedMessage() публичный Метод

public trackMostRecentPublishedMessage ( $aTypeName, StoredEvent $notification )
$aTypeName
$notification Ddd\Domain\Event\StoredEvent
    public function trackMostRecentPublishedMessage($aTypeName, $notification)
    {
        if (!$notification) {
            return;
        }
        $maxId = $notification->eventId();
        $publishedMessage = $this->find($aTypeName);
        if (!$publishedMessage) {
            $publishedMessage = new PublishedMessage($aTypeName, $maxId);
        }
        $publishedMessage->updateMostRecentPublishedMessageId($maxId);
        $this->getEntityManager()->persist($publishedMessage);
        $this->getEntityManager()->flush($publishedMessage);
    }