Skip to content
Snippets Groups Projects

Add new sub module for SFTP support. This includes a new source resource and...

Closed Ken Mortimer requested to merge issue/data_pipelines-3422542:3422542-add-in-sftp into 1.x

Add new sub module for SFTP support. This includes a new source resource and field item and widget to accomodate.

Closes #3422542

Merge request reports

Approval is optional

Closed by Ken MortimerKen Mortimer 11 months ago (Mar 5, 2024 2:22am UTC)

Merge details

  • The changes were not merged into .

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
5
6 /**
7 * Implements hook_install().
8 */
9 function data_pipelines_sftp_install(): void {
10 $source_plugin_manager = \Drupal::service('plugin.manager.data_pipelines_source');
11 $sources = array_values(array_unique(array_map(fn($definition) => $definition['id'], $source_plugin_manager->getDefinitions())));
12 $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager();
13 foreach ($sources as $source) {
14 $field_storage_definition = BaseFieldDefinition::create('sftp')
15 ->setLabel(new TranslatableMarkup('SFTP details'))
16 ->setRequired(TRUE)
17 ->setDisplayOptions('form', [
18 'type' => 'sftp',
19 ]);
20 $entity_definition_update_manager->installFieldStorageDefinition("{$source}_sftp", 'data_pipelines', 'data_pipelines', $field_storage_definition);
  • Jibran Ijaz
    Jibran Ijaz @jibran started a thread on the diff
  • 1 <?php
    2
    3 use Drupal\Core\Field\BaseFieldDefinition;
    4 use Drupal\Core\StringTranslation\TranslatableMarkup;
    5
    6 /**
    7 * Implements hook_install().
    8 */
    9 function data_pipelines_sftp_install(): void {
  • Please register or sign in to reply
    Loading