Documentation

MessageThread
in package
implements SaveableInterface Uses Saveable

A Thread of messages.

Tags
Entity

(repositoryClass="LotGD\Core\Models\Repositories\MessageThreadRepository")

Table

(name="message_threads")

Interfaces, Classes and Traits

SaveableInterface
Interface for createable models.

Table of Contents

$id  : mixed
$messages  : mixed
$participants  : mixed
$readonly  : mixed
$threadKey  : mixed
__construct()  : mixed
Constructor. Sets the (unique) threadKey.
_save()  : mixed
Static, protected save function to call from trait-overwriting methods.
addMessage()  : mixed
getId()  : int
Returns the primary id of this message.
getMessages()  : Collection
Returns a list of messages inside this thread.
getParticipants()  : Collection
Get a collection of participants in this thread.
isReadonly()  : bool
Returns true if the thread is "readonly".
save()  : mixed
Persists the MessageThread and adds itself to the participants.

Properties

$id

private mixed $id
Tags
Id

@Column(type="integer") @GeneratedValue

$messages

private mixed $messages
Tags
OneToMany

(targetEntity="Message", mappedBy="thread", cascade={"persist"})

$participants

private mixed $participants
Tags
ManyToMany

(targetEntity="Character", cascade={"persist"}, mappedBy="messageThreads")

$readonly

private mixed $readonly = false
Tags
Column

(type="boolean", options={"default"=false})

$threadKey

private mixed $threadKey
Tags
Column

(type="string", length=255, unique=true)

Methods

__construct()

Constructor. Sets the (unique) threadKey.

public __construct(string $threadKey, array<string|int, mixed> $participants[, bool $readonly = false ]) : mixed
Parameters
$threadKey : string
$participants : array<string|int, mixed>
$readonly : bool = false
Return values
mixed

_save()

Static, protected save function to call from trait-overwriting methods.

public static _save(SaveableInterface $object, EntityManagerInterface $em) : mixed
Parameters
$object : SaveableInterface
$em : EntityManagerInterface
Return values
mixed

getId()

Returns the primary id of this message.

public getId() : int
Return values
int

getMessages()

Returns a list of messages inside this thread.

public getMessages() : Collection
Return values
Collection

getParticipants()

Get a collection of participants in this thread.

public getParticipants() : Collection
Return values
Collection

isReadonly()

Returns true if the thread is "readonly".

public isReadonly() : bool
Return values
bool

save()

Persists the MessageThread and adds itself to the participants.

public save(EntityManagerInterface $em) : mixed
Parameters
$em : EntityManagerInterface
Return values
mixed

Search results