| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 28 | public function __construct($app) |
||
| 29 | { |
||
| 30 | // set up the model driver |
||
| 31 | $config = $app['config']; |
||
| 32 | $class = $config->get('models.driver'); |
||
| 33 | $this->driver = new $class(); |
||
| 34 | |||
| 35 | if ($this->driver instanceof DatabaseDriver) { |
||
| 36 | if (isset($app['database'])) { |
||
| 37 | $this->driver->setConnectionManager($app['database']); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | Model::setDriver($this->driver); |
||
| 42 | |||
| 43 | // pass optional configuration to model validator |
||
| 44 | Validator::configure($config->get('models.validator')); |
||
| 45 | } |
||
| 46 | |||
| 52 |