Documentation
    Preparing search index...

    Class DataObject

    Data objects constitute the agnostic glue between objects and backends. They handle data and identifiers in a protected registry This is what backends and objects manipulate, oblivious of the other.

    Hierarchy (View Summary)

    Implements

    • DataObjectType
    Index

    Constructors

    Properties

    _modified: boolean = false

    Has data been modified since last backend operation?

    _objectUri: ObjectUri
    _parentProp: string | undefined
    _populated: boolean = false
    _properties: Properties = {}
    _proxied: any
    _uid: string | undefined = undefined

    Accessors

    • get class(): any

      Returns any

    • get data(): any

      Returns any

    • get parentProp(): string | undefined

      Returns string | undefined

    • set parentProp(str: string | undefined): void

      Parameters

      • str: string | undefined

      Returns void

    • get path(): string

      Returns string

    • get properties(): Properties

      Returns Properties

    • get uid(): string | undefined

      Returns string | undefined

    • set uid(uid: string | undefined): void

      Parameters

      • uid: string | undefined

      Returns void

    • get uri(): ObjectUri

      Returns ObjectUri

    • set uri(uri: ObjectUri): void

      Parameters

      Returns void

    Methods

    • Parameters

      • objectsAsReferences: boolean = false
      • ignoreUnchanged: boolean = false
      • ignoreNulls: boolean = false
      • converters: {} = {}

      Returns {}

    • Parameters

      • properties: any[]

      Returns void

    • Appends a new property definition instance to the registry dynamically.

      Parameters

      • property: PropertyClassType

        The instantiated Property element.

      Returns void

    • Wrap instance into proxy to get access to properties

      Returns DataObject

      Proxy

    • Returns a completely duplicated payload and registry.

      Parameters

      • data: any = {}

        Optional data overrides.

      Returns Promise<DataObject>

      The cloned DataObject.

    • Returns property matching key or throw

      Parameters

      • key: string

        string

      Returns PropertyClassType

      BaseProperty

    • Return a map of all propoerties or only those matching the provided type

      Parameters

      • Optionaltype: string

      Returns {}

    • Checks if a specific property exists.

      Parameters

      • key: string

        The property name.

      Returns boolean

      Boolean indicating existence.

    • State check indicating if the object is fully populated.

      Returns boolean

      true if populated.

    • Populate data object from instant data or backend query

      Parameters

      • data: { name: string; [x: string]: unknown } | undefined = undefined

      Returns Promise<DataObject>

    • Populate data object from instant data or backend query

      Parameters

      • data: { [x: string]: unknown }

      Returns this

    • Modifies a property value directly.

      Parameters

      • key: string

        The property name.

      • val: any

        The desired value.

      Returns DataObject

      The updated DataObject for chaining.

    • Forces a completely new set of properties into the registry.

      Parameters

      • properties: Properties

        The dictionary of PropertyClassType entities.

      Returns void

    • Serializes the data object using advanced configuration params.

      Parameters

      • params: boolean | toJSONParams = false

        Serialization settings (e.g. resolve references, remove nulls).

      Returns { [x: string]: any }

      The raw serialized dictionary.

    • Flattens the object to a standard ObjectUri wrapper reference format.

      Returns { label: any; ref: string; uri: string }

      Reference object format.

    • Get value of given property

      Parameters

      • key: string

        string

      • transform: string | undefined = undefined

      Returns any

      any

    • Data object must be created from factory in order for async-loaded data to be available

      Parameters

      Returns DataObject

      DataObject