PHP Class OEModule\OphCoMessaging\components\MessageCreator

Create a Message event
Show file Open project: openeyes/openeyes Class Usage Examples

Protected Properties

Property Type Description
$episode Episode
$messageData array
$messageTemplate string
$recipient User
$sender User
$type OEModule\OphCoMessaging\models\OphCoMessaging_Message_MessageType

Public Methods

Method Description
__construct ( Episode $episode, User $sender, User $recipient, OphCoMessaging_Message_MessageType $type ) MessageCreator constructor.
emailAlert ( array $recipients, $subject, $content ) : mixed Sends an email alert when a message is created
save ( $message = '', string $source = '' ) : Element_OphCoMessaging_Message
setMessageData ( array $data )
setMessageTemplate ( $template )

Protected Methods

Method Description
getEventType ( ) : CActiveRecord
renderTemplate ( ) : string

Method Details

__construct() public method

MessageCreator constructor.
public __construct ( Episode $episode, User $sender, User $recipient, OphCoMessaging_Message_MessageType $type )
$episode Episode
$sender User
$recipient User
$type OEModule\OphCoMessaging\models\OphCoMessaging_Message_MessageType

emailAlert() public method

Sends an email alert when a message is created
public emailAlert ( array $recipients, $subject, $content ) : mixed
$recipients array
$subject
$content
return mixed

getEventType() protected method

protected getEventType ( ) : CActiveRecord
return CActiveRecord

renderTemplate() protected method

protected renderTemplate ( ) : string
return string

save() public method

public save ( $message = '', string $source = '' ) : Element_OphCoMessaging_Message
$message
$source string
return OEModule\OphCoMessaging\models\Element_OphCoMessaging_Message

setMessageData() public method

public setMessageData ( array $data )
$data array

setMessageTemplate() public method

public setMessageTemplate ( $template )
$template

Property Details

$episode protected property

protected Episode $episode
return Episode

$messageData protected property

protected array $messageData
return array

$messageTemplate protected property

protected string $messageTemplate
return string

$recipient protected property

protected User $recipient
return User

$sender protected property

protected User $sender
return User

$type protected property

protected OphCoMessaging_Message_MessageType,OEModule\OphCoMessaging\models $type
return OEModule\OphCoMessaging\models\OphCoMessaging_Message_MessageType