Revize 42c20ae6
Přidáno uživatelem Jan Šedivý před více než 5 roky(ů)
app/utils/TextParser.php | ||
---|---|---|
3 | 3 |
|
4 | 4 |
namespace App\Utils; |
5 | 5 |
|
6 |
use App\Enum\ESurfaceTypes; |
|
7 |
|
|
6 | 8 |
class TextParser |
7 | 9 |
{ |
8 | 10 |
private $textFile; |
... | ... | |
75 | 77 |
/** Funkce pro transformaci zkratek surfaceType na jejich příslušná idčka v db */ |
76 | 78 |
private function transformAbbrev($abbrev) |
77 | 79 |
{ |
78 |
switch ($abbrev) { |
|
79 |
case "rev.": |
|
80 |
return array_search("reverse", $this->surfaceTypes); |
|
81 |
case "u.e.": |
|
82 |
return array_search("upper edge", $this->surfaceTypes); |
|
83 |
case "lo.e.": |
|
84 |
return array_search("lower edge", $this->surfaceTypes); |
|
85 |
case "le.e.": |
|
86 |
return array_search("left edge", $this->surfaceTypes); |
|
87 |
// Domnenky, v test souborech se nenachazi -> udelat podle toho export |
|
88 |
case "r.e.": |
|
89 |
return array_search("right edge", $this->surfaceTypes); |
|
90 |
case "s.i.1": |
|
91 |
return array_search("seal impression 1", $this->surfaceTypes); |
|
92 |
case "s.i.2": |
|
93 |
return array_search("seal impression 2", $this->surfaceTypes); |
|
94 |
case "s.i.3": |
|
95 |
return array_search("seal impression 3", $this->surfaceTypes); |
|
96 |
case "s.i.4": |
|
97 |
return array_search("seal impression 4", $this->surfaceTypes); |
|
98 |
case "s.i.5": |
|
99 |
return array_search("seal impression 5", $this->surfaceTypes); |
|
100 |
case "s.i.6": |
|
101 |
return array_search("seal impression 6", $this->surfaceTypes); |
|
102 |
case "s.i.7": |
|
103 |
return array_search("seal impression 7", $this->surfaceTypes); |
|
104 |
case "s.i.8": |
|
105 |
return array_search("seal impression 8", $this->surfaceTypes); |
|
106 |
default: |
|
107 |
return array_search("obverse", $this->surfaceTypes); |
|
108 |
} |
|
80 |
return array_search(ESurfaceTypes::getSurfaceTypeFromAbbrev($abbrev), $this->surfaceTypes); |
|
109 | 81 |
} |
110 | 82 |
|
111 | 83 |
public function getTextFile() |
Také k dispozici: Unified diff
Re #7575 , Re #7572 Refaktoring importu/exportu