SerializationContext <T>
Index
Constructors
Properties
Methods
Constructors
constructor
- Parameters- config: Configuration<IDatabaseDriver<Connection>, EntityManager<IDatabaseDriver<Connection>>>
- populate: PopulateOptions<T>[] = []
- optionalfields: Set<string>
- optionalexclude: string[]
 - Returns SerializationContext<T>
Properties
readonlypath
readonlyvisited
Methods
close
- Returns void
isMarkedAsPopulated
- Parameters- entityName: string
- prop: string
 - Returns boolean
isPartiallyLoaded
- Parameters- entityName: string
- prop: string
 - Returns boolean
leave
- Parameters- entityName: string
- prop: string
 - Returns void
visit
- Returns true when there is a cycle detected. - Parameters- entityName: string
- prop: string
 - Returns boolean
staticpropagate
- When initializing new context, we need to propagate it to the whole entity graph recursively. - Parameters- root: SerializationContext<any>
- entity: Partial<any>
- isVisible: (meta, prop) => boolean
 - Returns void
Helper that allows to keep track of where we are currently at when serializing complex entity graph with cycles. Before we process a property, we call
visitthat checks if it is not a cycle path (but allows to pass cycles that are defined in populate hint). If not, we proceed and callleaveafterwards.