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