original_string: protected function generateManifest()
      {
          $manifest = $this->package->getManifestHeader();
  
          $requestedItems = $this->package->getServices();
  
          foreach ($requestedItems as $service => $resources) {
              foreach ($resources as $resourceName => $details) {
                  if (isset($this->data[$service][$resourceName])) {
                      $records = $this->data[$service][$resourceName];
                      foreach ($records as $i => $record) {
                          $api = $service . '/' . $resourceName;
                          switch ($api) {
                              case 'system/user':
                              case 'system/admin':
                                  $manifest['service'][$service][$resourceName][] =
                                      array_get($record, 'email', array_get($record, 'id', array_get($details, $i, [])));
                                  break;
                              default:
                                  $manifest['service'][$service][$resourceName][] =
                                      array_get($record, 'name', array_get($record, 'id', array_get($details, $i, [])));
                                  break;
                          }
                      }
                  } else {
                      $manifest['service'][$service][$resourceName] = $details;
                  }
              }
          }
  
          return $manifest;
      }
code: protected function generateManifest()
      {
          $manifest = $this->package->getManifestHeader();
  
          $requestedItems = $this->package->getServices();
  
          foreach ($requestedItems as $service => $resources) {
              foreach ($resources as $resourceName => $details) {
                  if (isset($this->data[$service][$resourceName])) {
                      $records = $this->data[$service][$resourceName];
                      foreach ($records as $i => $record) {
                          $api = $service . '/' . $resourceName;
                          switch ($api) {
                              case 'system/user':
                              case 'system/admin':
                                  $manifest['service'][$service][$resourceName][] =
                                      array_get($record, 'email', array_get($record, 'id', array_get($details, $i, [])));
                                  break;
                              default:
                                  $manifest['service'][$service][$resourceName][] =
                                      array_get($record, 'name', array_get($record, 'id', array_get($details, $i, [])));
                                  break;
                          }
                      }
                  } else {
                      $manifest['service'][$service][$resourceName] = $details;
                  }
              }
          }
  
          return $manifest;
      }
code_tokens: protected function generateManifest ( ) { $ manifest = $ this -> package -> getManifestHeader ( ) ; $ requestedItems = $ this -> package -> getServices ( ) ; foreach ( $ requestedItems as $ service => $ resources ) { foreach ( $ resources as $ resourceName => $ details ) { if ( isset ( $ this -> data [ $ service ] [ $ resourceName ] ) ) { $ records = $ this -> data [ $ service ] [ $ resourceName ] ; foreach ( $ records as $ i => $ record ) { $ api = $ service . '/' . $ resourceName ; switch ( $ api ) { case 'system/user' : case 'system/admin' : $ manifest [ 'service' ] [ $ service ] [ $ resourceName ] [ ] = array_get ( $ record , 'email' , array_get ( $ record , 'id' , array_get ( $ details , $ i , [ ] ) ) ) ; break ; default : $ manifest [ 'service' ] [ $ service ] [ $ resourceName ] [ ] = array_get ( $ record , 'name' , array_get ( $ record , 'id' , array_get ( $ details , $ i , [ ] ) ) ) ; break ; } } } else { $ manifest [ 'service' ] [ $ service ] [ $ resourceName ] = $ details ; } } } return $ manifest ; }
docstring: Generates the package manifest.
  
  @return array
docstring_tokens: Generates the package manifest .