You are here

public function VarietyList::get in Migrate Plus 8

Same name and namespace in other branches
  1. 8.5 migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php \Drupal\migrate_example_advanced_setup\Plugin\rest\resource\VarietyList::get()
  2. 8.2 migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php \Drupal\migrate_example_advanced_setup\Plugin\rest\resource\VarietyList::get()
  3. 8.3 migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php \Drupal\migrate_example_advanced_setup\Plugin\rest\resource\VarietyList::get()
  4. 8.4 migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php \Drupal\migrate_example_advanced_setup\Plugin\rest\resource\VarietyList::get()

Responds to GET requests.

Return value

\Drupal\rest\ResourceResponse The response containing the requested variety data.

File

migrate_example_advanced/migrate_example_advanced_setup/src/Plugin/rest/resource/VarietyList.php, line 32
Contains \Drupal\migrate_example_advanced_setup\Plugin\rest\resource\VarietyList.

Class

VarietyList
Provides varieties as two endpoints, one for reds and one for whites.

Namespace

Drupal\migrate_example_advanced_setup\Plugin\rest\resource

Code

public function get() {
  $data['items'] = [
    'retsina',
    'trebbiano',
    'valpolicella',
    'bardolino',
  ];
  $response = new ResourceResponse($data, 200);
  return $response;
}