File

projects/netgrif-components-core/src/lib/pfql/model/data-simple-expression.ts

Description

Represents a simple expression that operates on data fields in PFQL queries. Extends SimpleExpression to provide data field-specific functionality.

This class extracts and stores the data field identifier from a data field path, allowing for easy access to the field ID when constructing PFQL queries.

Extends

SimpleExpression

Index

Properties
Methods
Accessors

Constructor

Public constructor(dataFieldPath: string, operator: Operator<any>, operandValue: any, category?: Category<any>)
Parameters :
Name Type Optional
dataFieldPath string No
operator Operator<any> No
operandValue any No
category Category<any> Yes

Properties

Protected _dataFieldId
Type : string
Protected _category
Type : Category<any>
Inherited from SimpleExpression
Protected _operandValue
Type : any
Inherited from SimpleExpression
Protected _operator
Type : Operator<any>
Inherited from SimpleExpression

Methods

Public type
type()
Inherited from SimpleExpression
Returns : QueryItemType

Accessors

dataFieldId
getdataFieldId()
import {SimpleExpression} from "./simple-expression";
import {Operator} from "../../search/models/operator/operator";
import {Category} from "../../search/models/category/category";

/**
 * Represents a simple expression that operates on data fields in PFQL queries.
 * Extends SimpleExpression to provide data field-specific functionality.
 *
 * This class extracts and stores the data field identifier from a data field path,
 * allowing for easy access to the field ID when constructing PFQL queries.
 */
export class DataSimpleExpression extends SimpleExpression {
    protected _dataFieldId: string;

    public constructor(dataFieldPath: string, operator: Operator<any>, operandValue: any, category?: Category<any>) {
        super(operator, operandValue, category);

        const parts = dataFieldPath.split('.');
        this._dataFieldId = parts.length >= 3 && parts[0] === 'data' ? parts[1] : dataFieldPath;
    }

    public get dataFieldId(): string {
        return this._dataFieldId;
    }
}

results matching ""

    No results matching ""