models.server.Comment Class
Comment for models.server.Ticket
Item Index
Methods
Methods
addAttachment
-
data -
filename -
dataType -
stream
Add file attachment to a ticket comment
Parameters:
-
dataBuffer | String -
filenameString -
dataTypeString -
streamstream.ReadableNode.js readable stream
Returns:
addExistingAttachment
-
filename -
fileId -
size -
dataType -
user
Parameters:
-
filenameString -
fileIdString -
sizeNumber -
dataTypeString -
usermodels.server.User
Returns:
attachments
()
Bookshelf.Collection
Get all attachments of this comment
Returns:
Bookshelf.Collection of Attachment models
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
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:
textToEmail
()
String
Text for email notification when this model has changed
Returns:
toPlainText
()
String
Render model to plain text for email or similar usage
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.
