| Total Complexity | 3 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | abstract class InitRepository |
||
| 8 | { |
||
| 9 | protected $model; |
||
| 10 | private $cache_enabled; |
||
| 11 | protected $cache_time_forever; |
||
| 12 | |||
| 13 | abstract protected function getModelClass(); |
||
| 14 | |||
| 15 | public function __construct() |
||
| 16 | { |
||
| 17 | //длительность кеша |
||
| 18 | $this->cache_time_forever = (int) Config::get('app.cache_time_forever'); |
||
| 19 | $this->cache_enabled = (bool) Config::get('app.cache_enabled'); |
||
| 20 | |||
| 21 | $this->model = app($this->getModelClass()); |
||
| 22 | |||
| 23 | // Enable/disable cache repo |
||
| 24 | if (!$this->cache_enabled) { |
||
| 25 | $this->cache_time_forever = 0; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | protected function startConditions() |
||
| 32 | } |
||
| 33 | } |
||
| 34 |