blob: ef1d3514ffb2bec4bea1eaf65328c0b41823cd2a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<?php
class Modeldb extends Model
{
protected $database;
/** @var \WFlywheel\Repository */
protected $repo;
public function __construct()
{
$this->dbinit();
}
public function dbinit()
{
$this->database = new \JamesMoss\Flywheel\Config(Model::DATABASE_DIR, [
'query_class' => "\WFlywheel\Query",
'formatter' => new \WFlywheel\Formatter\JSON,
]);
}
public function storeinit(string $repo)
{
$this->repo = new \WFlywheel\Repository($repo, $this->database);
}
public function list()
{
return $this->repo->getAllIds();
}
}
|