Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / migrate_plus / migrate_example_advanced / migrate_example_advanced_setup / src / Plugin / rest / resource / VarietyList.php
1 <?php
2
3 namespace Drupal\migrate_example_advanced_setup\Plugin\rest\resource;
4
5 use Drupal\rest\Plugin\ResourceBase;
6 use Drupal\rest\ResourceResponse;
7
8 /**
9  * Provides varieties as two endpoints, one for reds and one for whites.
10  *
11  * @RestResource(
12  *   id = "migrate_example_advanced_variety_list",
13  *   label = @Translation("Advanced migration example - Variety list of data"),
14  *   uri_paths = {
15  *     "canonical" = "/migrate_example_advanced_variety_list"
16  *   }
17  * )
18  */
19 class VarietyList extends ResourceBase {
20
21   /**
22    * Responds to GET requests.
23    *
24    * @return \Drupal\rest\ResourceResponse
25    *   The response containing the requested variety data.
26    */
27   public function get() {
28     $data['items'] = ['retsina', 'trebbiano', 'valpolicella', 'bardolino'];
29
30     $response = new ResourceResponse($data, 200);
31     return $response;
32   }
33
34   /**
35    * {@inheritdoc}
36    */
37   public function permissions() {
38     // Remove permissions so the resource is available to all.
39     return [];
40   }
41
42 }