original_string: protected function getRelationships(array $item, array $included)
      {
          if (!isset($item['relationships']) || !is_array($item['relationships'])) {
              return [];
          }
  
          $result = [];
  
          foreach ($item['relationships'] as $relationKey => $relationValue) {
              foreach ($relationValue['data'] as $relationData) {
                  if (!isset($included[$relationData['type']][$relationData['id']])) {
                      throw new EntityNotFoundException("Data for type[{$relationData['type']}] and id[{$relationData['id']}] was not found in includes");
                  }
  
                  $result[$relationKey][$relationData['id']] = $included[$relationData['type']][$relationData['id']];
              }
          }
  
          return $result;
      }
code: protected function getRelationships(array $item, array $included)
      {
          if (!isset($item['relationships']) || !is_array($item['relationships'])) {
              return [];
          }
  
          $result = [];
  
          foreach ($item['relationships'] as $relationKey => $relationValue) {
              foreach ($relationValue['data'] as $relationData) {
                  if (!isset($included[$relationData['type']][$relationData['id']])) {
                      throw new EntityNotFoundException("Data for type[{$relationData['type']}] and id[{$relationData['id']}] was not found in includes");
                  }
  
                  $result[$relationKey][$relationData['id']] = $included[$relationData['type']][$relationData['id']];
              }
          }
  
          return $result;
      }
code_tokens: protected function getRelationships ( array $ item , array $ included ) { if ( ! isset ( $ item [ 'relationships' ] ) || ! is_array ( $ item [ 'relationships' ] ) ) { return [ ] ; } $ result = [ ] ; foreach ( $ item [ 'relationships' ] as $ relationKey => $ relationValue ) { foreach ( $ relationValue [ 'data' ] as $ relationData ) { if ( ! isset ( $ included [ $ relationData [ 'type' ] ] [ $ relationData [ 'id' ] ] ) ) { throw new EntityNotFoundException ( "Data for type[{$relationData['type']}] and id[{$relationData['id']}] was not found in includes" ) ; } $ result [ $ relationKey ] [ $ relationData [ 'id' ] ] = $ included [ $ relationData [ 'type' ] ] [ $ relationData [ 'id' ] ] ; } } return $ result ; }
docstring: Get relationships from array
  
  @param array $item
  @param array $included
  
  @return array
  @throws EntityNotFoundException
docstring_tokens: Get relationships from array