EntityManager/ThreadManager.php
/**
     * Ensures that the thread metadata are up to date.
     * @param ThreadInterface $thread
     */
Ensures that the thread metadata are up to date.
Ensures that the thread metadata are up to date .
private function doMetadata(ThreadInterface $thread): void
    {
        foreach ($thread->getParticipants() as $participant) {
            $meta = $thread->getMetadataForParticipant($participant);
            if (!$meta) {
                $meta = $this->threadMetadataFactory->create();
                $meta->setParticipant($participant);
                $thread->addMetadata($meta);
            }
        }
        foreach ($thread->getMessages() as $message) {
            $meta = $thread->getMetadataForParticipant($message->getSender());
            if (!$meta) {
                $meta = $this->threadMetadataFactory->create();
                $meta->setParticipant($message->getSender());
                $thread->addMetadata($meta);
            }
            $meta->setLastParticipantMessageDate($message->getCreatedAt());
        }
    }
private function doMetadata ( ThreadInterface $ thread ) : void { foreach ( $ thread -> getParticipants ( ) as $ participant ) { $ meta = $ thread -> getMetadataForParticipant ( $ participant ) ; if ( ! $ meta ) { $ meta = $ this -> threadMetadataFactory -> create ( ) ; $ meta -> setParticipant ( $ participant ) ; $ thread -> addMetadata ( $ meta ) ; } } foreach ( $ thread -> getMessages ( ) as $ message ) { $ meta = $ thread -> getMetadataForParticipant ( $ message -> getSender ( ) ) ; if ( ! $ meta ) { $ meta = $ this -> threadMetadataFactory -> create ( ) ; $ meta -> setParticipant ( $ message -> getSender ( ) ) ; $ thread -> addMetadata ( $ meta ) ; } $ meta -> setLastParticipantMessageDate ( $ message -> getCreatedAt ( ) ) ; } }
Ensures that the thread metadata are up to date.
Ensures that the thread metadata are up to date .
// Participants // Messages