Documentation
    Preparing search index...

    Class StudioProperty

    Core domain model representing a StudioProperty within the Quatrain Studio ecosystem.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _dataObject: DataObjectClass<any>
    _repositoryInstance: any = null
    COLLECTION: string = 'studio_property'

    The underlying database collection or table name.

    LABEL_KEY: string = 'name'

    Which property's value to use in backend as label for object reference

    PARENT_PROP: string | undefined

    The name of the property handling hierarchical parent relationships.

    PROPS_DEFINITION: any = StudioPropertyDef

    The schema definition dictating the properties of this model.

    REPOSITORY_CLASS: any = null

    The designated repository class for this model (defaults to BaseRepository).

    Accessors

    • get _(): any

      Returns any

    • get dataObject(): DataObjectClass<any>

      Returns DataObjectClass<any>

    • get path(): string

      Returns string

    • get uid(): any

      Returns any

    • get uri(): ObjectUri

      Returns ObjectUri

    Methods

    • Generates a lightweight Reference representation of the object. Commonly used for NoSQL or object relational mapping.

      Returns any

      A standardized object reference.

    • Deletes the object from the backend database. By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

      Parameters

      • hardDelete: boolean = false

        If true, permanently removes the record from the database.

      Returns Promise<DataObjectClass<any>>

      A promise resolving to the underlying DataObjectClass.

    • Return property object matching key

      Parameters

      • key: string

        string

      Returns any

    • Checks if a property exists on the data object.

      Parameters

      • key: string

        The property key.

      Returns boolean

      True if the property exists.

    • Creates a chained query for child records originating from the current instance. Used mainly for NoSQL backends to query subcollections seamlessly.

      Parameters

      • obj: any

        The child class definition (e.g., LogModel) to query.

      Returns Query<any>

      A new Query builder scoped to this parent instance.

    • Persists the current state of the object to the configured backend database. Triggers creation or update operations depending on whether the object already exists.

      Returns Promise<StudioProperty>

      A promise resolving to the instance itself for chaining.

    • Proxies a set command to the underlying data object.

      Parameters

      • key: string

        The property key.

      • val: any

        The value to assign.

      Returns any

      The DataObject instance for chaining.

    • Serializes the current object path / identity.

      Returns any

      The JSON serialized ObjectUri.

    • Fetches the value of a property.

      Parameters

      • key: string

        The property key.

      Returns any

      The property value or null if undefined.

    • Validates the object's properties against the model definition. Throws a ValidationError if any mandatory properties are missing or empty.

      Returns void

    • Orchestrates the creation of a DataObject linked to this class schema. Can dynamically read state from the backend if a URI is provided.

      Parameters

      • src: string | ObjectUri | DataObjectClass<any> | undefined = undefined

        The initialization source (ObjectUri, string path, or existing DAO).

      • child: any = ...

        The child class definition.

      Returns Promise<DataObjectClass<any>>

      A promise resolving to the fully instantiated DataObject.

    • Instantiates a new StudioProperty or loads one from the database.

      Parameters

      • src: any = undefined

        Initial data or an existing URI/ID.

      Returns Promise<StudioProperty>

      A promise resolving to the model instance.

    • Merges the parent class property definitions with the child's explicit properties.

      Parameters

      • child: any = ...

        The specific child class.

      Returns PersistedDataObject

      A factory-initialized DataObject representing the merged structure.

    • Fetches and hydrates an object directly from its backend storage path via the repository facade.

      Type Parameters

      • T

      Parameters

      • path: string

        The backend unique identifier or full URI path (e.g. "users/123" or "123").

      Returns Promise<T>

      A promise resolving to the populated class instance.

    • Looks up a property definition by its name from the merged PROPS_DEFINITION.

      Parameters

      • key: string

        The property name.

      Returns any

      The property definition object if found.

    • Registers an explicit repository instance for this model class.

      Parameters

      • repoInstance: any

        The repository instance to register.

      Returns void

    • Retrieves the pre-bound repository instance for this model class. Dynamically instantiates the default or customized BaseRepository if not already cached.

      Returns BaseRepository<any>

      The bound BaseRepository instance.

      If the default BaseRepository class has not been loaded/configured.