diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-12-04 20:39:48 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-12-04 20:39:48 +0100 |
commit | 42e89ac398bdf2a98167b0b71123c98e297b2130 (patch) | |
tree | 623c5e42d9b40a7372f17c070e2b39f52dc44ed1 /app/class/modelart.php | |
parent | dd14929505e3fd0bc1710ed757b501d3ec1f6ca1 (diff) | |
download | wcms-42e89ac398bdf2a98167b0b71123c98e297b2130.tar.gz wcms-42e89ac398bdf2a98167b0b71123c98e297b2130.zip |
editor right bar
Diffstat (limited to 'app/class/modelart.php')
-rw-r--r-- | app/class/modelart.php | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/app/class/modelart.php b/app/class/modelart.php index e9f6ec3..54a6613 100644 --- a/app/class/modelart.php +++ b/app/class/modelart.php @@ -107,9 +107,12 @@ class Modelart extends Modeldb } - - - + /** + * @param array $artlist List of Art2 + * @param array $tagchecked list of tags + * @param string $tagcompare string, can be 'OR' or 'AND', set the tag filter method + * @return array $array + */ public function filtertagfilter(array $artlist, array $tagchecked, $tagcompare = 'OR') { @@ -168,9 +171,30 @@ class Modelart extends Modeldb return $taglist; } - public function count() + /** + * @param array $taglist list of tags + * @param array $artlist list of Art2 + * @return array list of tags each containing list of id + */ + + public function tagartlist(array $taglist, array $artlist) { - return $this->bdd->query(' SELECT COUNT(*) FROM ' . $this->arttable . ' ')->fetchColumn(); + $tagartlist = []; + foreach ($taglist as $tag) { + $tagartlist[$tag] = $this->filtertagfilter($artlist, [$tag]); + } + return $tagartlist; + } + + public function lasteditedartlist(int $last , array $artlist) + { + $this->artlistsort($artlist, 'datemodif', -1); + $artlist = array_slice($artlist, 0, $last); + $idlist = []; + foreach ($artlist as $art) { + $idlist[] = $art->id(); + } + return $idlist; } } |