diff options
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; - } + |