equal
deleted
inserted
replaced
40 * @return array key is id, value is the name |
40 * @return array key is id, value is the name |
41 */ |
41 */ |
42 public function getNames(array $ids) { |
42 public function getNames(array $ids) { |
43 |
43 |
44 if(count($ids) > config('corpusparole.lexvo_max_ids')) { |
44 if(count($ids) > config('corpusparole.lexvo_max_ids')) { |
45 throw new LexvoResolverException("Too manys ids provided"); |
45 return array_reduce( |
|
46 array_map([$this, 'getNames'], array_chunk($ids, config('corpusparole.lexvo_max_ids'))), |
|
47 'array_merge', |
|
48 [] |
|
49 ); |
|
50 // throw new LexvoResolverException("Too manys ids provided"); |
46 } |
51 } |
47 |
52 |
48 $lexvoids = array_map([$this, 'checkLexvoId'], $ids); |
53 $lexvoids = array_map([$this, 'checkLexvoId'], $ids); |
49 $lexvoidsMap = array_combine($lexvoids, $ids); |
54 $lexvoidsMap = array_combine($lexvoids, $ids); |
50 |
55 |