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 { 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 = new Date(item.startdate); this.endDate = new Date(item.enddate); this.description = item.description; this.files = JsonSerializer.fromJSONArray(item.files, ContentFile) this.dmps = JsonSerializer.fromJSONArray(item.dmps, UrlListingItem) return this; } }