You are here

function support_ticket_load in Support Ticketing System 8

Same name and namespace in other branches
  1. 6 support.module \support_ticket_load()
  2. 7 support.module \support_ticket_load()

Loads a support ticket entity from the database.

Parameters

int $nid: The support ticket ID.

bool $reset: (optional) Whether to reset the support_ticket_load_multiple() cache. Defaults to FALSE.

Return value

\Drupal\support_ticket\SupportTicketInterface|null A fully-populated support ticket entity, or NULL if the support ticket is not found.

File

modules/support_ticket/support_ticket.module, line 243
Enables use of support tickets with optional time tracking.

Code

function support_ticket_load($nid = NULL, $reset = FALSE) {
  if ($reset) {
    \Drupal::entityManager()
      ->getStorage('support_ticket')
      ->resetCache(array(
      $nid,
    ));
  }
  return SupportTicket::load($nid);
}