aboutsummaryrefslogtreecommitdiff
path: root/app/class/Modeldb.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/class/Modeldb.php')
-rw-r--r--app/class/Modeldb.php71
1 files changed, 33 insertions, 38 deletions
diff --git a/app/class/Modeldb.php b/app/class/Modeldb.php
index 953521f..784b45f 100644
--- a/app/class/Modeldb.php
+++ b/app/class/Modeldb.php
@@ -9,42 +9,37 @@ use Wcms\Flywheel\Repository;
class Modeldb extends Model
{
- protected $database;
- /** @var Repository */
- protected $repo;
-
-
- public function __construct()
- {
- $this->dbinit();
- }
-
-
- public function dbinit($dir = Model::DATABASE_DIR)
- {
- $this->database = new Flywheel\Config($dir , [
- 'query_class' => Query::class,
- 'formatter' => new JSON,
- ]);
- }
-
- public function storeinit(string $repo)
- {
- $this->repo = new Repository($repo, $this->database);
- }
-
- /**
- * List every IDs of a database
- *
- * @return array of ID strings
- */
- public function list() : array
- {
- return $this->repo->getAllIds();
- }
-
-
-
-
-
+ protected $database;
+ /** @var Repository */
+ protected $repo;
+
+
+ public function __construct()
+ {
+ $this->dbinit();
+ }
+
+
+ public function dbinit($dir = Model::DATABASE_DIR)
+ {
+ $this->database = new Flywheel\Config($dir, [
+ 'query_class' => Query::class,
+ 'formatter' => new JSON(),
+ ]);
+ }
+
+ public function storeinit(string $repo)
+ {
+ $this->repo = new Repository($repo, $this->database);
+ }
+
+ /**
+ * List every IDs of a database
+ *
+ * @return array of ID strings
+ */
+ public function list(): array
+ {
+ return $this->repo->getAllIds();
+ }
}