addTableDefaults example

if ($entity_type->hasKey('revision')) {
      $revision_key = $entity_type->getKey('revision');
      $key_name = $this->getEntityIndexName($entity_type$revision_key);
      $schema['unique keys'][$key_name] = [$revision_key];
      $schema['foreign keys'][$entity_type_id . '__revision'] = [
        'table' => $this->storage->getRevisionTable(),
        'columns' => [$revision_key => $revision_key],
      ];
    }

    $this->addTableDefaults($schema);

    return $schema;
  }

  /** * Initializes common information for a revision table. * * @param \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type * The entity type. * * @return array * A partial schema array for the revision table. */
Home | Imprint | This part of the site doesn't use cookies.