Skip to content

breeze-client / EntityBase

Abstract Class: EntityBase ​

Defined in: src/entity/entity-base.ts:27

A base class for entity classes: it declares the members Breeze supplies, so that a class extending it declares only its own properties. The classes breeze-gen-entities writes extend it.

ts
export class Customer extends EntityBase {
  declare customerID: string;
  declare companyName: string;
}

Extend it with a class of your own to give every entity the same behaviour:

ts
export abstract class AppEntityBase extends EntityBase {
  get isNew() { return this.entityAspect.entityState.isAdded(); }
}

It has no runtime behaviour - Breeze does not require it. A class can instead implement Entity and declare these members itself.

Implements ​

Constructors ​

Constructor ​

new EntityBase(): EntityBase

Defined in: src/entity/entity-base.ts:29

Called by the constructor of the class that extends it. It does nothing.

Returns ​

EntityBase

Properties ​

entityAspect ​

entityAspect: EntityAspectOf<EntityBase>

Defined in: src/entity/entity-base.ts:33

The EntityAspect Breeze attaches to the entity. Of this, so that originalValues and getOriginalValue know the class's properties.

Implementation of ​

Entity.entityAspect


entityType ​

entityType: EntityType

Defined in: src/entity/entity-base.ts:35

The EntityType the entity's class is registered for.

Implementation of ​

Entity.entityType


getProperty ​

getProperty: (prop) => any

Defined in: src/entity/entity-base.ts:37

Returns the value of a property by name. Installed by the model library adapter.

Parameters ​

prop ​

string

Returns ​

any

Implementation of ​

Entity.getProperty


setProperty ​

setProperty: (prop, value) => any

Defined in: src/entity/entity-base.ts:39

Sets the value of a property by name. Installed by the model library adapter.

Parameters ​

prop ​

any

value ​

any

Returns ​

any

Implementation of ​

Entity.setProperty

Released under the MIT License.