Preparing search index...

    Интерфейс, описывающий мета-модель

    interface IMetaModel {
        attributeGroups: ModelCollection<AttributeGroup>;
        customProperties: ModelCollection<
            Universe.Platform.CustomProperty.CustomProperty,
        >;
        dirty: boolean;
        displayName: StringField;
        hasData: BooleanField;
        modelId: number;
        name: StringField;
        observabilitySet: Set<ReactiveProp>;
        onChangeDirty: ModelDirtyChangeHandler;
        onValidation: (_validationResult: IValidationResult) => void;
        phantom: boolean;
        validationResult: IValidationResult;
        addAttribute(attribute: IMetaAbstractAttribute): void;
        afterInit(): void;
        beforeInit(): void;
        calculateDeepDirty(): boolean;
        calculateDirty(): boolean;
        calculateFieldsDirty(): boolean;
        calculateModelDirty(): boolean;
        checkFieldDirty(field: AbstractField<any>): boolean;
        clearValidationResult(): void;
        clone<T extends AbstractModel<any>>(includeSystemProps?: boolean): T;
        commit(): void;
        commitFields(): void;
        commitHasMany(): void;
        commitHasOne(): void;
        createFields(data: any): void;
        createHasMany(data: any, initConfig: Partial<ModelOptions>): void;
        createHasOne(data: any, initConfig: Partial<ModelOptions>): void;
        getAttribute(name: string): undefined | IMetaAbstractAttribute;
        getAttributes(): (IMetaAbstractAttribute | IMetaComplexAttribute)[];
        getCollection(name: string): any;
        getComplexAttributes(): undefined | IMetaComplexAttribute[];
        getDeepDirty(): boolean;
        getDirty(): boolean;
        getErrorMessage(validatorName: string): string;
        getField(name: string): undefined | AbstractField<any, BaseOptions>;
        getFieldJsonDescriptor(
            propertyName: string,
        ):
            | undefined
            | ClassPropertyDescriptor<any, AbstractField<any, BaseOptions>>;
        getFieldMainDescriptor(
            propertyName: string,
        ): ClassPropertyDescriptor<any, AbstractField<any, BaseOptions>>;
        getFieldMainDescriptors(): ClassPropertyDescriptor<
            any,
            AbstractField<any, BaseOptions>,
        >[];
        getFields(): any[];
        getFieldsMap(): { [key: string]: any };
        getHasManyCollection(): any[];
        getHasManyJsonDescriptor(
            propertyName: string,
        ): undefined | ClassPropertyDescriptor<any, ModelCollection<any>>;
        getHasManyMainDescriptor(
            propertyName: string,
        ): ClassPropertyDescriptor<any, ModelCollection<any>>;
        getHasManyMainDescriptors(): ClassPropertyDescriptor<
            any,
            ModelCollection<any>,
        >[];
        getHasManyMap(): { [key: string]: any };
        getHasOneCollection(): any[];
        getHasOneJsonDescriptor(
            propertyName: string,
        ): undefined | ClassPropertyDescriptor<any, AbstractModel<any>>;
        getHasOneMainDescriptor(
            propertyName: string,
        ): ClassPropertyDescriptor<any, AbstractModel<any>>;
        getHasOneMainDescriptors(): ClassPropertyDescriptor<
            any,
            AbstractModel<any>,
        >[];
        getHasOneMap(): { [key: string]: any };
        getHasOneOriginalCollection(): { [key: string]: any };
        getLogicErrors(): string[];
        getMetaAttributesByPropertyValue(
            property: string,
            value: undefined | null | string | number | boolean,
        ): IMetaAbstractAttribute[];
        getModelDirty(): boolean;
        getNamespace(): keyof INamespace;
        getPhantom(): boolean;
        getPrimaryKeyValue(): string;
        getPropertiesAsMapByDescriptors<
            T extends
                | AbstractModel<any>
                | AbstractField<any, BaseOptions>
                | ModelCollection<any>,
        >(
            descriptors: ClassPropertyDescriptor<any, T>[],
        ): { [key in string]?: ModelProperty<any, T, any> };
        getPropertiesByDescriptors<
            T extends
                | AbstractModel<any>
                | AbstractField<any, BaseOptions>
                | ModelCollection<any>,
        >(
            descriptors: ClassPropertyDescriptor<any, T>[],
        ): ModelProperty<any, T, any>[];
        getPropertyByDescriptor<
            T extends
                | AbstractModel<any>
                | AbstractField<any, BaseOptions>
                | ModelCollection<any>,
        >(
            descriptor: ClassPropertyDescriptor<any, T>,
        ): undefined | ModelProperty<any, T, any>;
        getReferencesChanged(): boolean;
        getTypeName(): string;
        getValidationResult(level?: number): Map<string, string[]>;
        isEqual(model: AbstractModel<any>, config?: EqualConfig): boolean;
        removeAttribute(attribute: IMetaAbstractAttribute): void;
        revert(): void;
        serialize(
            config?: SerializationConfig,
        ): Partial<Pick<GetTypes<any>, string>>;
        setDeepDirty(flag: boolean): void;
        setDirty(flag: boolean): void;
        setPhantomCascade(phantom: boolean): void;
        setReactive(props: ReactiveProp[]): void;
        setReactiveCascade(props: ReactiveProp[]): void;
        setReferencesChanged(flag: boolean): void;
        updateDeepDirty(): void;
        updateDirty(): void;
        updateModelDirty(): void;
        validate(disablePropagation?: boolean): IValidationResult;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    Коллекция групп атрибутов модели

    Коллекция дополнительных параметров модели

    dirty: boolean
    displayName: StringField
    hasData: BooleanField

    Есть ли у модели созданные экземпляры

    modelId: number
    observabilitySet: Set<ReactiveProp>
    onValidation: (_validationResult: IValidationResult) => void
    phantom: boolean
    validationResult: IValidationResult

    Methods

    • Метод, добавляющий атрибут в модель

      Parameters

      Returns void

    • This method is called at the final stage of model initialization

      Returns void

    • The method calls before the model initialization begins

      Returns void

    • Cloning model data

      Type Parameters

      Parameters

      • OptionalincludeSystemProps: boolean

        phantom, dirty, original values

      Returns T

      T

    • Creates model fields

      Parameters

      • data: any

      Returns void

    • Метод, возвращающий атрибут модели

      Parameters

      • name: string

        Имя атрибута

      Returns undefined | IMetaAbstractAttribute

    • Метод, возвращающий список комплексных атрибутов модели

      Returns undefined | IMetaComplexAttribute[]

    • Parameters

      • validatorName: string

      Returns string

    • Returns an array of model fields

      Returns any[]

    • This method is called at the validation. If there is logical errors in model, here will be list of them

      Returns string[]

    • Метод, возвращающий список атрибутов с указанным значением поля (attribute[property] === value)

      Parameters

      • property: string

        Имя поля

      • value: undefined | null | string | number | boolean

        Значение поля

      Returns IMetaAbstractAttribute[]

    • Метод, возвращающий пространство имён, к которому принадлежит модель

      Returns keyof INamespace

    • Returns whether a new record is selected

      Returns boolean

    • Имя модели

      Returns string

    • Parameters

      • Optionallevel: number

      Returns Map<string, string[]>

    • Метод, удаляющий атрибут из модели

      Parameters

      Returns void

    • Parameters

      • flag: boolean

      Returns void

    • Sets the phantom attribute cascadingly for the model

      Parameters

      • phantom: boolean

      Returns void