1 | <?php |
||
21 | class Index extends BaseIndex |
||
22 | { |
||
23 | private $originalName; |
||
24 | |||
25 | /** |
||
26 | * Stores created types to avoid recreation. |
||
27 | * |
||
28 | * @var array |
||
29 | */ |
||
30 | private $typeCache = []; |
||
31 | |||
32 | /** |
||
33 | * Returns the original name of the index if the index has been renamed for reindexing |
||
34 | * or realiasing purposes. |
||
35 | * |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getOriginalName() |
||
42 | |||
43 | 12 | public function getType($type) |
|
44 | { |
||
45 | 12 | if (isset($this->typeCache[$type])) { |
|
46 | 2 | return $this->typeCache[$type]; |
|
47 | } |
||
48 | |||
49 | 12 | return $this->typeCache[$type] = parent::getType($type); |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * Reassign index name. |
||
54 | * |
||
55 | * While it's technically a regular setter for name property, it's specifically named overrideName, but not setName |
||
56 | * since it's used for a very specific case and normally should not be used |
||
57 | * |
||
58 | * @param string $name Index name |
||
59 | */ |
||
60 | public function overrideName($name) |
||
65 | } |
||
66 |