2020-09-16 22:33:53 +08:00
|
|
|
import { AbstractCollectionModel } from 'Model/AbstractCollection';
|
2020-09-15 15:43:53 +08:00
|
|
|
import { EmailModel } from 'Model/Email';
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2020-09-16 22:33:53 +08:00
|
|
|
export class EmailCollectionModel extends AbstractCollectionModel
|
2020-09-15 15:43:53 +08:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param {?Array} json
|
2020-09-15 21:08:08 +08:00
|
|
|
* @returns {EmailCollectionModel}
|
2020-09-15 15:43:53 +08:00
|
|
|
*/
|
|
|
|
static reviveFromJson(items) {
|
2020-10-23 21:15:54 +08:00
|
|
|
return super.reviveFromJson(items, email => EmailModel.reviveFromJson(email));
|
2020-09-15 15:43:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {boolean=} friendlyView = false
|
|
|
|
* @param {boolean=} wrapWithLink = false
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
2022-09-30 17:38:51 +08:00
|
|
|
toString(friendlyView, wrapWithLink) {
|
|
|
|
return this.map(email => email.toLine(friendlyView, wrapWithLink)).join(', ');
|
2020-09-15 15:43:53 +08:00
|
|
|
}
|
|
|
|
}
|