Mercurial > hg > isophonics-drupal-site
annotate core/modules/aggregator/src/ItemStorageSchema.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\aggregator; |
Chris@0 | 4 |
Chris@0 | 5 use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema; |
Chris@0 | 6 use Drupal\Core\Field\FieldStorageDefinitionInterface; |
Chris@0 | 7 |
Chris@0 | 8 /** |
Chris@0 | 9 * Defines the item schema handler. |
Chris@0 | 10 */ |
Chris@0 | 11 class ItemStorageSchema extends SqlContentEntityStorageSchema { |
Chris@0 | 12 |
Chris@0 | 13 /** |
Chris@0 | 14 * {@inheritdoc} |
Chris@0 | 15 */ |
Chris@0 | 16 protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) { |
Chris@0 | 17 $schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping); |
Chris@0 | 18 $field_name = $storage_definition->getName(); |
Chris@0 | 19 |
Chris@17 | 20 if ($table_name == $this->storage->getBaseTable()) { |
Chris@0 | 21 switch ($field_name) { |
Chris@0 | 22 case 'timestamp': |
Chris@0 | 23 $this->addSharedTableFieldIndex($storage_definition, $schema, TRUE); |
Chris@0 | 24 break; |
Chris@0 | 25 |
Chris@0 | 26 case 'fid': |
Chris@0 | 27 $this->addSharedTableFieldForeignKey($storage_definition, $schema, 'aggregator_feed', 'fid'); |
Chris@0 | 28 break; |
Chris@0 | 29 } |
Chris@0 | 30 } |
Chris@0 | 31 |
Chris@0 | 32 return $schema; |
Chris@0 | 33 } |
Chris@0 | 34 |
Chris@0 | 35 } |