0

I don't understand what the thread class is in FOSMessageBundle (https://github.com/FriendsOfSymfony/FOSMessageBundle).

Could you explain what it represents?

Mick
  • 26,684
  • 12
  • 104
  • 126

2 Answers2

2

A thread is like a conversation, it contains a list of messages between the same participants.


A close look at the model class will help you understand how it works:

A thread contains a collection of Messages as well as important Metadata about the thread.

/**
 * Messages contained in this thread.
 *
 * @var Collection|MessageInterface[]
 */
protected $messages;
/**
 * Thread metadata.
 *
 * @var Collection|ThreadMetadata[]
 */
protected $metadata;

/**
 * Users participating in this conversation.
 *
 * @var Collection|ParticipantInterface[]
 */
protected $participants;
Mick
  • 26,684
  • 12
  • 104
  • 126
  • thanks a lot mick , i just wonder if i can use this bundle as a chat component – Tagarikdi Djakouba May 06 '17 at 15:21
  • Hi @TagarikdiDjakouba, yes you can definitely do a chat system from the bundle - actually, it is very easy to do - all the logic is already done for you. – Mick May 07 '17 at 09:31
-1

a thread contains message of different participants, like a forum