Entity Class
Base model class with "id" column
Item Index
Methods
Methods
$include
-
[options]
include all relational models and returns new model
Parameters:
-
[options]
Object optional-
[async=true]
Boolean optionalget async values
-
[props]
Array(String) optionalinclude only given props
-
Returns:
new model
$unset
-
prop
unset property and create a new model
Parameters:
-
prop
Stringproperty name
Returns:
this
deprecated
-
methodName
-
message
Show indication message of deprecated method
Parameters:
-
methodName
String -
message
String
Returns:
diff
-
plainObj
-
[options]
Get diff props
Parameters:
-
plainObj
Any -
[options]
Object optional-
[ignores]
Array(String) optionalprop names to skip checking diff
-
Returns:
enum
()
Object(key: String => Number)
public
Returns:
error
-
reason
-
[message]
create instance of DomainError
Parameters:
-
reason
Stringreason of the error
-
[message]
String optional
Returns:
getDiff
-
plainObj
-
[options]
Get diff prop values
Parameters:
-
plainObj
Any -
[options]
Object optional-
[ignores]
Array(String) optionalprop names to skip checking diff
-
Returns:
getParent
()
Function
get parent class
Returns:
include
-
[options]
include all relational models if not set
Parameters:
-
[options]
Object optional-
[async=true]
Boolean optionalget async values
-
[props]
Array(String) optionalinclude only given props
-
Returns:
self
included
()
Boolean
Check if all subentities are included.
Returns:
inherit
-
anotherModel
inherit value of anotherModel
Parameters:
-
anotherModel
BaseModel
Returns:
this
plainClone
()
Object
public
clone the model as a plain object
Returns:
setEnum
-
prop
-
value
set enum value
Parameters:
-
prop
String -
value
String | Number
setRoot
()
protected
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:
plainObject