| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 6 | public static function getDBHandler($db) |
||
| 7 | { |
||
| 8 | return function($query, $args) use ($db) { |
||
| 9 | $q = $db->prepare('select * from nodes where '.$query); |
||
| 10 | $result = $q->execute($args); |
||
|
|
|||
| 11 | $dataset = []; |
||
| 12 | while ( $data = $q->fetch(\PDO::FETCH_ASSOC) ) { |
||
| 13 | $value = (object) $data; |
||
| 14 | $value->data = json_decode($value->data); |
||
| 15 | $value->ctime = strtotime($value->ctime); |
||
| 16 | $value->mtime = strtotime($value->mtime); |
||
| 17 | $path = $value->parent.$value->name.'/'; |
||
| 18 | $dataset[$path] = $value; |
||
| 19 | } |
||
| 20 | return $dataset; |
||
| 21 | }; |
||
| 43 | } |