diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-12-23 18:20:57 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-12-23 18:20:57 +0100 |
commit | e8566a57cf1b9cc2eed10429f27840d17da945ef (patch) | |
tree | 9902d9f4dc2e871819af21ede642e50aaab1518b /app/class/modeldb.php | |
parent | 532cdf4bb82ab7cc6fa7659d9aec3ce122b2ec52 (diff) | |
download | wcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.tar.gz wcms-e8566a57cf1b9cc2eed10429f27840d17da945ef.zip |
feature users
Diffstat (limited to 'app/class/modeldb.php')
-rw-r--r-- | app/class/modeldb.php | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/app/class/modeldb.php b/app/class/modeldb.php index bc2a0c7..ef1d351 100644 --- a/app/class/modeldb.php +++ b/app/class/modeldb.php @@ -1,10 +1,9 @@ <?php class Modeldb extends Model { - protected $arttable; protected $database; /** @var \WFlywheel\Repository */ - protected $artstore; + protected $repo; public function __construct() @@ -19,37 +18,19 @@ class Modeldb extends Model 'query_class' => "\WFlywheel\Query", 'formatter' => new \WFlywheel\Formatter\JSON, ]); - $this->artstore = new \WFlywheel\Repository(Config::arttable(), $this->database); } - - public function getlister() + public function storeinit(string $repo) { - $artlist = []; - $list = $this->artstore->findAll(); - foreach ($list as $artdata) { - $artlist[$artdata->id] = new Art2($artdata); - } - return $artlist; + $this->repo = new \WFlywheel\Repository($repo, $this->database); } public function list() { - return $this->artstore->getAllIds(); + return $this->repo->getAllIds(); } - public function getlisterid(array $idlist = []) - { - $artdatalist = $this->artstore->query() - ->where('__id', 'IN', $idlist) - ->execute(); - - $artlist = []; - foreach ($artdatalist as $id => $artdata) { - $artlist[$id] = new Art2($artdata); - } - return $artlist; - } + |