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