API Docs for:
Show:

models.server.Tag Class

Ticket tags.

Tags with a status: are handled as a special status tags. Only one tag with the prefix can be active at once.

Methods

clones

() Bookshelf.Collection

Return Collection for clones of this tag

createdAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:12

Returns:

Date:

deletedAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:36

Returns:

Date:

fetchOrCreate

(
  • identifier
)
Bluebird.Promise

Fetch or create a model uniquely identified by the columns defined in the identifier

Parameters:

  • identifier Object

    Object of table columns

Returns:

Bluebird.Promise:

with the model instance

getStatus

() String

Inherited from models.TagMixin but overwritten in models/TagMixin.js:19

Get status part of the tag if the tag is status tag

Returns:

String:

hasVisibility

(
  • visibility
  • models
)

Visibility assertion helper

Parameters:

  • visibility String
  • models Array

    Array of models.server.Visibility models

Returns:

Boolean

isSame

(
  • other
)

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:48

Return true if the other object is built using the same constructor and they have the same id

Parameters:

Returns:

Boolean

isSoftDeleted

() Boolean

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:28

Returns:

Boolean:

isStatusTag

() Boolean

Inherited from models.TagMixin but overwritten in models/TagMixin.js:9

Returns true if the tag is a status tag

Returns:

Boolean:

softDelete

(
  • byUser
)
Bluebird.Promise

Set timestamp to deletedAt

Parameters:

Returns:

softDeleteStatusTagsFor

(
  • ticket
  • byUser
)
Bluebird.Promise static

Soft delete status tags for the given ticket

Parameters:

Returns:

statusTagsFor

(
  • ticket
)
Bookshelf.Collection static

Fetch all status tags for the given ticket

Parameters:

Returns:

Bookshelf.Collection:

Collection of models.server.Tag models

uniqueId

() String

Returns:

String:

updatedAt

() Date

Inherited from models.BaseMixin but overwritten in models/BaseMixin.js:20

Returns:

Date:

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.