Chris@0: database = $database; Chris@0: parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $event_dispatcher); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function getDatabase() { Chris@0: return parent::getDatabase(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Gets the field schema. Chris@0: * Chris@0: * @param array $id_definition Chris@0: * An array defining the field, with a key 'type'. Chris@0: * Chris@0: * @return array Chris@0: * A field schema depending on value of key 'type'. An empty array is Chris@0: * returned if 'type' is not defined. Chris@0: * Chris@0: * @throws \Drupal\migrate\MigrateException Chris@0: */ Chris@0: protected function getFieldSchema(array $id_definition) { Chris@0: if (!isset($id_definition['type'])) { Chris@0: return []; Chris@0: } Chris@0: switch ($id_definition['type']) { Chris@0: case 'integer': Chris@0: return [ Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: ]; Chris@0: Chris@0: case 'string': Chris@0: return [ Chris@0: 'type' => 'varchar', Chris@0: 'length' => 255, Chris@0: 'not null' => FALSE, Chris@0: ]; Chris@0: Chris@0: default: Chris@0: throw new MigrateException($id_definition['type'] . ' not supported'); Chris@0: } Chris@0: } Chris@0: Chris@0: }