diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-11-02 02:03:52 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-11-02 02:03:52 +0100 |
commit | 85824de70ded75c98bd50220160e2171fdc8df41 (patch) | |
tree | 11480f65ff97ddbb3ea4806ff1f313628ced15a0 /w/class/modelart.php | |
parent | 36ef34af2abcdea63a73b578208f20ca40b52f49 (diff) | |
download | wcms-85824de70ded75c98bd50220160e2171fdc8df41.tar.gz wcms-85824de70ded75c98bd50220160e2171fdc8df41.zip |
render working and url auto link
Diffstat (limited to 'w/class/modelart.php')
-rw-r--r-- | w/class/modelart.php | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/w/class/modelart.php b/w/class/modelart.php index be72611..37262ad 100644 --- a/w/class/modelart.php +++ b/w/class/modelart.php @@ -34,9 +34,12 @@ class Modelart extends Modeldb $this->artstore->store($artdata); } - public function get(Art2 $art) + public function get($art) { - $artdata = $this->artstore->findById($art->id()); + if($art instanceof Art2) { + $id = $art->id(); + } + $artdata = $this->artstore->findById($id); if($artdata !== false) { return new Art2($artdata); } else { @@ -44,24 +47,18 @@ class Modelart extends Modeldb } } + public function delete(Art2 $art) + { + $this->artstore->delete($art->id()); + } + public function update(Art2 $art) { - $art->updateedited(); $artdata = new \JamesMoss\Flywheel\Document($art->dry()); $artdata->setId($art->id()); $this->artstore->store($artdata); } - public function getlister() - { - $artlist = []; - $list = $this->artstore->findAll(); - foreach ($list as $artdata) { - $artlist[] = new Art2($artdata); - } - return $artlist; - } - public function exist3($id) { |