◆ convertFromJson()
ilMailValueObjectJsonService::convertFromJson |
( |
string |
$json | ) |
|
- Returns
- list<ilMailValueObject>
Definition at line 50 of file class.ilMailValueObjectJsonService.php.
References ilStr\strLen().
53 $array = json_decode($json,
true, 512, JSON_THROW_ON_ERROR);
55 foreach ($array as $object_values) {
57 $object_values[
'from'],
58 $object_values[
'recipients'],
59 $object_values[
'recipients_cc'],
60 $object_values[
'recipients_bcc'],
61 ilStr::strLen($object_values[
'subject']) > 255 ? ilStr::substr($object_values[
'subject'], 0, 255) : $object_values[
'subject'],
62 $object_values[
'body'],
63 $object_values[
'attachments'],
64 $object_values[
'is_using_placholders'],
65 $object_values[
'should_save_in_sent_box']
static strLen(string $a_string)
◆ convertToJson()
ilMailValueObjectJsonService::convertToJson |
( |
array |
$mail_value_objects | ) |
|
- Parameters
-
list<ilMailValueObject> | $mail_value_objects |
Definition at line 26 of file class.ilMailValueObjectJsonService.php.
29 foreach ($mail_value_objects as $mail_value_object) {
31 $mail_data[
'from'] = $mail_value_object->getFrom();
32 $mail_data[
'recipients'] = $mail_value_object->getRecipients();
33 $mail_data[
'recipients_cc'] = $mail_value_object->getRecipientsCC();
34 $mail_data[
'recipients_bcc'] = $mail_value_object->getRecipientsBCC();
35 $mail_data[
'attachments'] = $mail_value_object->getAttachments();
36 $mail_data[
'body'] = $mail_value_object->getBody();
37 $mail_data[
'subject'] = $mail_value_object->getSubject();
38 $mail_data[
'is_using_placholders'] = $mail_value_object->isUsingPlaceholders();
39 $mail_data[
'should_save_in_sent_box'] = $mail_value_object->shouldSaveInSentBox();
41 $records[] = $mail_data;
44 return json_encode($records, JSON_THROW_ON_ERROR);
The documentation for this class was generated from the following file: