Returns an attribute set of all attributes.
Returns an attribute set of all callable (non-writable) attributes.
Clears the modified attribute state. Typically used after calling an update/save endpoint to signify that the instance is in sync with the upstream datasource.
Sets multiple attribute values using the provided data
. The incoming data is parsed into an
attribute set using [[Entity.parseData()
]], before being sanitized, normalized and validated.
Returns an attribute set of all attributes that have been configured as hidden
.
Returns an attribute set of all attributes that have been configured as immutable
.
Returns an attribute set of the attributes provided in names
.
Returns an attribute set of all attributes that have been modified since instantiation or the
last call to [[Entity.clearModified()
]].
Returns an attribute set of all attributes that have not been configured as immutable
.
Normalizes a value
using the configured normalizer
function for the attribute name
. If
the attribute does not have a normalizer function configured then that value is returned as-is.
The function will have this
scoped to the Entity
instance.
Returns the value of the attribute provided in name
.
Sanitizes a value
using the configured sanitizer
function for the attribute name
. The
function will have this
scoped to the Entity
instance.
Sets the value
for the attribute name
. Values can only be set for mutable, writable
attributes. The value will be sanitized, normalized and validated.
Returns the data to expose when stringifying the instance to JSON.
Stringifies the instance to JSON.
Validates a value
using the configured validator
function for the attribute name
. If
the attribute does not have a validator function configured then that value is assumed valid.
The function will have this
scoped to the Entity
instance.
Returns an attribute set of all attributes that have not been configured as hidden
.
Returns an attribute set an all writable (non-callable) attributes.
Generated using TypeDoc
Creates a new
Entity
instance. TheattrConfigSet
defines the attributes available on theEntity
instance. Values defined inattrConfigSet
are trusted and therefore not sanitized, normalized nor validated. Data provided viadata
must be compatible with the data expected by [[Entity.fill()
]] but, unlike [[Entity.fill()
]], may also include values for immutable attributes.