35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { Serializable } from "../Serializable";
|
|
import { ContentFile } from "../../models/files/ContentFile";
|
|
import { JsonSerializer } from "../../utilities/JsonSerializer";
|
|
import { UrlListingComponent } from "../../shared/components/url-listing/url-listing.component";
|
|
import { UrlListingItem } from "../../shared/components/url-listing/UrlListingItem";
|
|
|
|
export class ProjectListingModel implements Serializable<ProjectListingModel> {
|
|
public id: String;
|
|
public label: String;
|
|
public abbreviation: String;
|
|
public reference: String;
|
|
public uri: String;
|
|
public status: String;
|
|
public startDate: Date;
|
|
public endDate: Date;
|
|
public description: String;
|
|
public files: ContentFile[] = new Array();
|
|
public dmps: UrlListingItem[] = new Array();
|
|
|
|
fromJSONObject(item: any): ProjectListingModel {
|
|
this.id = item.id;
|
|
this.label = item.label;
|
|
this.abbreviation = item.abbreviation;
|
|
this.reference = item.reference;
|
|
this.uri = item.uri;
|
|
this.status = item.status;
|
|
this.startDate = item.startDate ? new Date(item.startDate) : item.startDate;
|
|
this.endDate = item.endDate ? new Date(item.endDate) : item.endDate;
|
|
this.description = item.description;
|
|
this.files = JsonSerializer.fromJSONArray(item.files, ContentFile)
|
|
this.dmps = JsonSerializer.fromJSONArray(item.dmps, UrlListingItem)
|
|
return this;
|
|
}
|
|
}
|