From 44e54592f146319dec6f7dd6481a7cb420cd56e9 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Tue, 5 Nov 2019 16:42:50 +0100 Subject: improvments : documentor --- app/class/modelpage.php | 18 ++++++++++++++++-- app/class/page.php | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/class/modelpage.php b/app/class/modelpage.php index a47ebdb..68ccf23 100644 --- a/app/class/modelpage.php +++ b/app/class/modelpage.php @@ -12,7 +12,7 @@ class Modelpage extends Modeldb parent::__construct(); $this->storeinit(Config::pagetable()); if(!$this->dircheck(Model::HTML_RENDER_DIR)) { - throw new Exception("Media error : Cant create /rendernew folder"); + throw new Exception("Media error : Cant create /render folder"); } } @@ -32,7 +32,14 @@ class Modelpage extends Modeldb } - public function getlisterid(array $idlist = []) + /** + * Scan database for specific pages IDs and return array of Pages objects + * + * @param array $idlist list of ID strings + * + * @return array of Page objects + */ + public function getlisterid(array $idlist = []) : array { $pagedatalist = $this->repo->query() ->where('__id', 'IN', $idlist) @@ -45,6 +52,11 @@ class Modelpage extends Modeldb return $pagelist; } + /** + * Store new page in the database + * + * @param Page $page object + */ public function add(Page $page) { @@ -194,6 +206,7 @@ class Modelpage extends Modeldb * @param array $pagelist List of Page * @param array $tagchecked list of tags * @param string $tagcompare string, can be 'OR' or 'AND', set the tag filter method + * * @return array $array */ @@ -280,6 +293,7 @@ class Modelpage extends Modeldb /** * @param array $taglist list of tags * @param array $pagelist list of Page + * * @return array list of tags each containing list of id */ diff --git a/app/class/page.php b/app/class/page.php index 299e448..a55e7cb 100644 --- a/app/class/page.php +++ b/app/class/page.php @@ -480,7 +480,7 @@ class Page { if (is_string($tag)) { - if (strlen($tag) < self::LEN and is_string($tag)) { + if (strlen($tag) < self::LEN) { $tag = strip_tags(trim(strtolower($tag))); $tag = str_replace('*', '', $tag); $tag = str_replace(' ', '', $tag); -- cgit v1.2.3