Condition class

Represents some condition.

Implements

ExpressionParent

Index

Constructors

Public Properties

Protected Properties

Public Methods

Constructors


constructor

The default constructor. ⊕ new Condition(query: Query,tag?: CondTag): Condition

Parameters:


Public Properties


blockId

The block id.

● blockId: string


expressions

The list of expression.

● expressions: Expression[]


justAdded

Condition enabled option.

● justAdded: boolean


linkType

The linking type.

● linkType: LinkType = LinkType.All


tag

The condition tag.

● tag: CondTag


Protected Properties


_enabled

The value indicating whether this Condition is enabled.

● _enabled: boolean


_id

● _id: string


conditions

The list of conditions.

● conditions: Condition[]


parent

● parent: Condition = null


query

● query: Query


Public Methods


addCondition

▸ addCondition(cond: Condition): number

Parameters:

Returns number


addExpressionByOperand

▸ addExpressionByOperand(operand: Operand,val?: string): Expression

Parameters:

  • operand: Operand
  • val: string, Default value = null

Returns Expression


clearConditions

▸ clearConditions(): void

Returns void


expressionChanged

▸ expressionChanged(expr: Expression,oldValue: string): void

Parameters:

Returns void


fireChangedEvent

▸ fireChangedEvent(): void

Returns void


getConditions

▸ getConditions(): Condition[]

Returns Condition[]


getExpressionIndex

▸ getExpressionIndex(expr: Expression): number

Parameters:

Returns number


getLevel

▸ getLevel(): number

Returns number


getModel

▸ getModel(): DataModel

Returns DataModel


getOperatorId

▸ getOperatorId(): string

Returns string


getParent

▸ getParent(): Condition

Returns Condition


getQuery

▸ getQuery(): Query

Returns Query


isEmpty

▸ isEmpty(): boolean

Returns boolean


isGroup

▸ isGroup(): boolean

Returns boolean


isInJoin

Indicates whether this condition must be placed into JOIN clause in result SQL.

▸ isInJoin(): boolean

Returns boolean


isParameterized

The value indicating whether this condition is parameterized.

▸ isParameterized(): boolean

Returns boolean


isReadOnly

Indicates whether this condition is read-only.

▸ isReadOnly(): boolean

Returns boolean


loadFromData

Loads condtion from its JSON representation object.

▸ loadFromData(model: DataModel,data: ConditionData): void

Parameters:

Returns void


removeConditionAt

▸ removeConditionAt(index: number): void

Parameters:

  • index: number

Returns void


saveToData

Saves condition to JSON representation object.

▸ saveToData(): ConditionData

Returns ConditionData - The JSON representation object.


setInJoin

▸ setInJoin(value: boolean): void

Parameters:

  • value: boolean

Returns void


setOperatorId

▸ setOperatorId(newOperatorId: string,silent?: boolean): void

Parameters:

  • newOperatorId: string
  • silent: boolean, Default value = false

Returns void


setParameterized

▸ setParameterized(value: boolean): void

Parameters:

  • value: boolean

Returns void


setParent

▸ setParent(parent: Condition): void

Parameters:

Returns void


setReadOnly

▸ setReadOnly(value: boolean): void

Parameters:

  • value: boolean

Returns void