| 1 | <?php |
||
| 14 | class TypeConfig |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | private $config; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | private $mapping; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | private $name; |
||
| 30 | |||
| 31 | 9 | public function __construct($name, array $mapping, array $config = array()) |
|
| 32 | { |
||
| 33 | 9 | $this->config = $config; |
|
| 34 | 9 | $this->mapping = $mapping; |
|
| 35 | 9 | $this->name = $name; |
|
| 36 | 9 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @return bool|null |
||
| 40 | */ |
||
| 41 | 6 | public function getDateDetection() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | 6 | public function getDynamicDateFormats() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return string|null |
||
| 56 | */ |
||
| 57 | 6 | public function getAnalyzer() |
|
| 58 | { |
||
| 59 | 6 | return $this->getConfig('analyzer'); |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @return array |
||
| 64 | */ |
||
| 65 | 6 | public function getMapping() |
|
| 69 | |||
| 70 | /** |
||
| 71 | * @return string|null |
||
| 72 | */ |
||
| 73 | 6 | public function getModel() |
|
| 74 | { |
||
| 75 | 6 | return isset($this->config['persistence']['model']) ? |
|
| 76 | 3 | $this->config['persistence']['model'] : |
|
| 77 | 6 | null; |
|
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @return bool|null |
||
| 82 | */ |
||
| 83 | 6 | public function getNumericDetection() |
|
| 87 | |||
| 88 | /** |
||
| 89 | * @return string |
||
| 90 | */ |
||
| 91 | 5 | public function getName() |
|
| 95 | |||
| 96 | /** |
||
| 97 | * @return string|null |
||
| 98 | */ |
||
| 99 | 6 | public function getDynamic() |
|
| 103 | |||
| 104 | /** |
||
| 105 | * @param string $key |
||
| 106 | * @return null|string |
||
| 107 | */ |
||
| 108 | 6 | private function getConfig($key) |
|
| 114 | } |
||
| 115 |