You are here

function support_ticket_load_multiple in Support Ticketing System 8

Loads support ticket entities from the database.

This function should be used whenever you need to load more than one support ticket from the database. Support tickets are loaded into memory and will not require database access if loaded again during the same page request.

Parameters

array $stid: (optional) An array of entity IDs. If omitted, all entities are loaded.

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

Return value

\Drupal\support_ticket\SupportTicketInterface[] An array of support ticket entities indexed by nid.

See also

entity_load_multiple()

\Drupal\Core\Entity\Query\EntityQueryInterface

File

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

Code

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