You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
558 B

  1. export class RelationItem {
  2. constructor(
  3. public id: number,
  4. public fromId: number,
  5. public toId: number,
  6. public type: number,
  7. ) {
  8. }
  9. static valueOf(
  10. {id, from_id, to_id, type}: { id: number, from_id: number, to_id: number, type: number }
  11. ): RelationItem {
  12. return new RelationItem(id, from_id, to_id, type)
  13. }
  14. toObject(): Object {
  15. return {
  16. id: this.id,
  17. from_id: this.fromId,
  18. to_id: this.toId,
  19. type: this.type,
  20. }
  21. }
  22. }