API Docs for:
Show:

Entity Class

Extends BaseModel
Module: base-domain

Base model class with "id" column

Methods

getFacade

() Facade

Inherited from Base: src/lib/base.coffee:32

get facade

the implementation is in Facade#requre()

Returns:

getPropInfo

() PropInfo public

get an instance of PropInfo, which summarizes properties of this class

Returns:

include

(
  • [options]
)
Promise(BaseModel)

include all relational models if not set

Parameters:

  • [options] Object optional
    • [recursive] Boolean optional

      recursively include models or not

Returns:

Promise(BaseModel):

self

inherit

(
  • anotherModel
)
BaseModel

inherit value of anotherModel

Parameters:

Returns:

BaseModel:

this

setEntityProp

(
  • prop
  • submodel
)
BaseModel

set related model(s)

Parameters:

  • prop String

    property name of the related model

  • submodel Entity | Array

Returns:

BaseModel:

this

toPlainObject

() Object

create plain object without relational entities descendants of Entity are removed, but not descendants of BaseModel descendants of Entity in descendants of BaseModel are removed ( = recursive)

Returns:

Object:

plainObject

unsetEntityProp

(
  • prop
)
BaseModel

unset related model(s)

Parameters:

  • prop String

    property name of the related models

Returns:

BaseModel:

this

Properties

id

Any

primary key for the model