17e909ab22200d282dd015e9fa7e39de826e21d4
[yaffs-website] / web / core / modules / file / src / FileStorageSchema.php
1 <?php
2
3 namespace Drupal\file;
4
5 use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
6 use Drupal\Core\Field\FieldStorageDefinitionInterface;
7
8 /**
9  * Defines the file schema handler.
10  */
11 class FileStorageSchema extends SqlContentEntityStorageSchema {
12
13   /**
14    * {@inheritdoc}
15    */
16   protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) {
17     $schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping);
18     $field_name = $storage_definition->getName();
19
20     if ($table_name == $this->storage->getBaseTable()) {
21       switch ($field_name) {
22         case 'status':
23         case 'changed':
24         case 'uri':
25           $this->addSharedTableFieldIndex($storage_definition, $schema, TRUE);
26           break;
27       }
28     }
29
30     return $schema;
31   }
32
33 }