You are here

protected function SupportTicketStorageSchema::getEntitySchema in Support Ticketing System 8

Gets the entity schema for the specified entity type.

Entity types may override this method in order to optimize the generated schema of the entity tables. However, only cross-field optimizations should be added here; e.g., an index spanning multiple fields. Optimizations that apply to a single field have to be added via SqlContentEntityStorageSchema::getSharedTableFieldSchema() instead.

Parameters

\Drupal\Core\Entity\ContentEntityTypeInterface $entity_type: The entity type definition.

bool $reset: (optional) If set to TRUE static cache will be ignored and a new schema array generation will be performed. Defaults to FALSE.

Return value

array A Schema API array describing the entity schema, excluding dedicated field tables.

Overrides SqlContentEntityStorageSchema::getEntitySchema

File

modules/support_ticket/src/SupportTicketStorageSchema.php, line 22
Contains \Drupal\support_ticket\SupportTicketStorageSchema.

Class

SupportTicketStorageSchema
Defines the support schema handler.

Namespace

Drupal\support_ticket

Code

protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
  $schema = parent::getEntitySchema($entity_type, $reset);
  $schema['support_ticket_field_data']['indexes'] += array(
    // @todo update indexes[ once default views are built
    'support_ticket__status_type' => array(
      'status',
      'support_ticket_type',
      'stid',
    ),
    'support_ticket__title_type' => array(
      'title',
      array(
        'support_ticket_type',
        4,
      ),
    ),
  );
  return $schema;
}