models.server.Base Class
Base class for server Models
Item Index
Methods
- byId static
- createdAt
- deletedAt
- fetchOrCreate
- hasVisibility
- isModel static
- isSame
- isSoftDeleted
- softDelete
- toAttr static
- toId static
- uniqueId
- updatedAt
Methods
byId
-
id
Shortcut for getting models by id
Parameters:
-
idNumber | models.server.Base
Returns:
subclass of models.server.Base
createdAt
()
Date
Returns:
deletedAt
()
Date
Returns:
fetchOrCreate
-
identifier
Fetch or create a model uniquely identified by the columns defined in
the identifier
Parameters:
-
identifierObjectObject of table columns
Returns:
with the model instance
hasVisibility
-
visibility -
models
Visibility assertion helper
Parameters:
-
visibilityString -
modelsArrayArray of models.server.Visibility models
Returns:
Boolean
isModel
-
UNKNOWN
Returns true if the given value is a Backbone.Model like object
Parameters:
-
UNKNOWNAny
Returns:
isSame
-
other
Return true if the other object is built using the same constructor and they have the same id
Parameters:
-
otherBackbone.Model
Returns:
Boolean
isSoftDeleted
()
Boolean
Returns:
softDelete
-
byUser
Set timestamp to deletedAt
Parameters:
-
byUsermodels.server.User | NumberThe user who deleted the model
Returns:
toAttr
-
model -
attr
Get attribute using get() if model is Model instance or just return the value
Parameters:
-
modelBackbone.Model | Any -
attrStringAttribute to get from the model
Returns:
toId
-
model
Return id for the model or just return the id if the id itself is passed.
Parameters:
-
modelBackbone.Model | Any
Returns:
uniqueId
()
String
Returns:
updatedAt
()
Date
Returns:
Properties
type
String
The database table name
Virtual database field. Use .get("type") to access it.
unique_id
String
Unique id between tables.
Virtual database field. Use .get("unique_id") to access it.
