Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityAction

EntityAction is an 'Enum' containing all of the valid actions that can occur to an 'Entity'.

Hierarchy

Index

Constructors

constructor

Properties

_$typeName

_$typeName: string

Type of the enum; set in prototype of each enum

name

name: string

The name of this symbol

Static AcceptChanges

AcceptChanges: EntityAction = new EntityAction()

AcceptChanges was called on the entity, or its entityState was set to Unmodified.

Static Attach

Attach: EntityAction = new EntityAction( { _isAttach: true })

Entity was attached via an AttachEntity call.

Static AttachOnImport

AttachOnImport: EntityAction = new EntityAction({ _isAttach: true})

Entity was attached as a result of an import.

Static AttachOnQuery

AttachOnQuery: EntityAction = new EntityAction({ _isAttach: true})

Entity was attached as a result of a query.

Static Clear

Clear: EntityAction = new EntityAction({ _isDetach: true})

The EntityManager was cleared. All entities detached.

Static Detach

Detach: EntityAction = new EntityAction( { _isDetach: true })

Entity was detached

Static EntityStateChange

EntityStateChange: EntityAction = new EntityAction()

The EntityState of the entity was changed.

Static MergeOnImport

MergeOnImport: EntityAction = new EntityAction({ _isModification: true })

Properties on the entity were merged as a result of an import.

Static MergeOnQuery

MergeOnQuery: EntityAction = new EntityAction({ _isModification: true })

Properties on the entity were merged as a result of a query.

Static MergeOnSave

MergeOnSave: EntityAction = new EntityAction({ _isModification: true })

Properties on the entity were merged as a result of a save

Static PropertyChange

PropertyChange: EntityAction = new EntityAction({ _isModification: true})

A property on the entity was changed.

Static RejectChanges

RejectChanges: EntityAction = new EntityAction({ _isModification: true})

RejectChanges was called on the entity.

Methods

isAttach

  • isAttach(): boolean
  • Is this an 'attach' operation? ( Attach, AttachOnQuery or AttachOnImport)

    Returns boolean

isDetach

  • isDetach(): boolean
  • Is this a 'detach' operation? ( Detach, Clear)

    Returns boolean

isModification

  • isModification(): boolean
  • Is this a 'modification' operation? ( PropertyChange, MergeOnQuery, MergeOnSave, MergeOnImport, RejectChanges)

    Returns boolean

toJSON

  • toJSON(): object

toString

  • toString(): string

Static contains

  • Returns whether an Enum contains a specified symbol.

    let symbol = DayOfWeek.Friday;
    if (DayOfWeek.contains(symbol)) {
        // do something
    }

    Parameters

    Returns boolean

    Whether this Enum contains the specified symbol.

Static fromName

  • fromName(name: string): any
  • Returns an Enum symbol given its name.

    let dayOfWeek = DayOfWeek.from("Thursday");
    // nowdayOfWeek === DayOfWeek.Thursday

    Parameters

    • name: string

      Name for which an enum symbol should be returned.

    Returns any

    The symbol that matches the name or 'undefined' if not found.

Static getNames

  • getNames(): string[]
  • Returns the names of all of the symbols contained within this Enum.

    let symbols = DayOfWeek.getNames();

    Returns string[]

    All of the names of the symbols contained within this Enum.

Static getSymbols

  • Returns all of the symbols contained within this Enum.

    let symbols = DayOfWeek.getSymbols();

    Returns BreezeEnum[]

    All of the symbols contained within this Enum.

Static resolveSymbols

  • resolveSymbols(): object[]
  • Seals this enum so that no more symbols may be added to it. This should only be called after all symbols have already been added to the Enum. This method also sets the 'name' property on each of the symbols.

    DayOfWeek.resolveSymbols();

    Returns object[]

Generated using TypeDoc