models.server.Attachment Class
Attachments for models.server.Ticket
Item Index
Methods
Methods
createdAt
()
Date
Returns:
deletedAt
()
Date
Returns:
fetchContent
()
Bluebird.Promise
Fetch content of this attachment
Returns:
with data of the attachment in a buffer
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
getComputedFileId
()
String
Returns:
getContentType
()
String
Get attachment content-type ensuring utf-8 if it is a text type charset=utf-8
Returns:
getFileId
()
String
Returns:
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:
isStillUploading
()
Boolean
Returns:
readStream
()
stream.Readable
Return readable stream for this ticket data
Returns:
softDelete
-
byUser
Set timestamp to deletedAt
Parameters:
-
byUsermodels.server.User | NumberThe user who deleted the model
Returns:
uniqueId
()
String
Returns:
updatedAt
()
Date
Returns:
writeStream
-
stream
Write readable stream to this attachment. The returned promise is resolved when the stream has been fully written.
Parameters:
-
streamstream.ReadableNode.js readable stream
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.
