Guide for Developers » Devblocks » API » Classes » Objects

Ticket

DAO_Ticket

class DAO_Ticket
constant ID

The id field.

static create($fields)
Parameters:
  • $fields (array) – An array of the fields to set for the new ticket. The array should be keyed on the DAO_Ticket class constants above.
Returns:

An integer containing the id of the new ticket.

Creates a ticket.

static createRequester($raw_email, $ticket_id)
Parameters:
  • $raw_email (string) – The email address to add as a requester.
  • $ticket_id (integer) – The id of the ticket to add the requester to.
Returns:

A boolean representing whether or not the requester was successfully added to the provided ticket.

Adds a requester to a ticket.

static deleteRequester($id, $address_id)
Parameters:
  • $id (integer) – The address to remove as a requester.
  • $ticket_id (integer) – The id of the ticket to remove the requester from.
Returns:

A boolean representing whether or not the requester was successfully added to the provided ticket.

Deletes the specified requester from the specified ticket.

static get($id)
Parameters:
  • $id (integer) – The id of the ticket to retrieve.

Retrieves a ticket.

static getByContext($context, $context_ids)
Parameters:
  • $context (string) – The context to filter against.
  • $context_ids (mixed) – An integer or array of integers representing the IDs of the objects to filter against.
Returns:

An array of Model_Tickets.

Retrieves the tickets for a specific object.

static getFields
Returns:An array of fields and their human-friendly translations.

Returns an array of all ticket fields.

static getWhere($where=null, $sortBy='created', $sortAsc=false, $limit=null)
Parameters:
  • $where (string) – Sets the WHERE clause of the query. If null, no WHERE clause will be used, and all objects will be returned.
  • $sortBy (string) – The field to sort by. Defaults to ‘created’.
  • $sortAsc (boolean) – A boolean indicating whether to sort by descending or ascending values. Defaults to false (descending) by default.
  • $limit (integer) – The amount of records to LIMIT the query result to.
Returns:

An array of Model_Ticket objects.

Retrieves the objects matching the criteria specified.

static getTicketIdByMask($mask)
Parameters:
  • $mask (string) – The ticket mask.
Returns:

An integer containing the id of the matching ticket.

Retrieves the ticket id for the supplied mask.

static getTicketByMask($mask)
Parameters:
  • $mask (string) – The ticket mask.
Returns:

An instace of Model_Ticket containing the matching ticket.

Retrieves the ticket for the supplied mask.

static getTicketByMessageId($message_id)
Parameters:
  • $message_id (integer) – The message_id.
Returns:

An array containing the ticket_id and message_id.

Retrieves the ticket which contains the supplied message_id.

static merge($ids)
Parameters:
  • $ids (array) – The tickets to merge.
Returns:

An integer containing the id of the ticket that the supplied tickets were merged into.

Merges any number of tickets.

static rebuild($id)
Parameters:
  • $id (integer) – The id of the ticket to rebuild.
Returns:

A boolean representing whether the ticket was successfully rebuilt or not.

Updates the first_message_id, first_wrote_id, last_message_id and last_wrote_id of a ticket, or deletes it if there are no messages. This is useful if you’ve deleted messages on the ticket.

static random

Returns a random ticket.

static search($columns, $params, $limit=10, $page=0, $sortBy=null, $sortAsc=null, $withCounts=true)
Parameters:
  • $columns (array) – An array of columns to include in the result.
  • $params (array) – An array of DevblocksSearchCriteria to restrict the search to.
  • $limit (integer) – The max amount of results to return.
  • $page (integer) – If the results have been limited, this parameter will cause the results to return the next set.
  • $sortBy (string) – Defaults to null.
  • $sortAsc (boolean) – Defaults to null (false).
  • $withCounts (boolean) – A boolean indicating whether to include counts in the return array or not. Defaults to true.
Returns:

An array with the results, and the total number of records if $withCounts is true.

Returns objects matching the given criteria.

static update($ids, $fields)
Parameters:
  • $ids (mixed) – An integer or array of integers representing the ids of the objects to be updated.
  • $fields (array) – An array of the fields to set. The array should be keyed on the DAO_Ticket class constants above.

Updates a ticket (or multiple tickets).

static updateWhere($fields, $where)
Parameters:
  • $fields (array) – An array of the fields to set for the specified ticket(s). The array should be keyed on the DAO_Ticket class constants above.
  • $where (array) – A string specifying the WHERE clause of the update query.

Updates a ticket (or multiple tickets) based on the provided $where parameter.

Model_Ticket

class Model_Ticket
property $id

The id of the ticket.

property $mask

The mask of the ticket.

property $subject

The subject of the ticket.

property $is_waiting

A boolean indicating whether the ticket is waiting for a customer reply or not.

property $is_closed

A boolean indicating whether the ticket is closed or not.

property $is_deleted

A boolean indicating whether the ticket is deleted or not.

property $group_id

The group the ticket is in.

property $bucket_id

The bucket the ticket is in.

property $org_id

The org the ticket belongs to.

property $owner_id

The worker who owns the ticket.

property $first_message_id

The id of the first message on the ticket.

property $last_message_id

The id of the last message on the ticket.

property $first_wrote_address_id

The id of the address of the first person who wrote a message on the ticket.

property $last_wrote_address_id

The id of the address of the last person who wrote a message on the ticket.

property $created_date

The date the ticket was created.

property $updated_date

The date the ticket was updated.

property $due_date

The date the ticket is due.

property $spam_score

The spam score of the ticket.

property $spam_training

The spam training of the ticket.

property $interesting_words

Interesting words that are part of the ticket (for spam purposes).

property $last_action_code

The last action code of the ticket.

getFirstMessage()
Returns:An instance of Model_Message containing the message.

Retrieves the first message on the ticket.

getLastMessage()
Returns:An instance of Model_Message containing the message.

Retrieves the last message on the ticket.

getMessage()
Returns:An array of Model_Message objects.

Retrieves all messages on the ticket.

getOrg()
Returns:An instance of Model_ContactOrg containing the organization.

Retrieves the Organization set for the ticket.

getRequesters()
Returns:An array of Model_Address objects.

Retrieves all of the requesters set for a ticket.

Previous topic:
« Objects
Next topic:
Address »