From 393709dcf84776c760146722560816172167fe98 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 12 Jan 2019 14:53:41 +0100 Subject: visit counter --- app/class/art2.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'app/class/art2.php') diff --git a/app/class/art2.php b/app/class/art2.php index a378bd4..2341ff9 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -37,6 +37,7 @@ class Art2 protected $invites; protected $readers; protected $affcount; + protected $visitcount; protected $editcount; @@ -110,6 +111,7 @@ class Art2 $this->setinvites([]); $this->setreaders([]); $this->setaffcount(0); + $this->setvisitcount(0); $this->seteditcount(0); } @@ -432,6 +434,11 @@ class Art2 return $this->affcount; } + public function visitcount($type = 'int') + { + return $this->visitcount; + } + public function editcount($type = 'int') { return $this->editcount; @@ -739,6 +746,15 @@ class Art2 } } + public function setvisitcount($visitcount) + { + if (is_int($visitcount)) { + $this->visitcount = $visitcount; + } elseif (is_numeric($visitcount)) { + $this->visitcount = intval($visitcount); + } + } + public function seteditcount($editcount) { if (is_int($editcount)) { @@ -762,6 +778,11 @@ class Art2 $this->affcount++; } + public function addvisitcount() + { + $this->visitcount++; + } + public function updateedited() { $now = new DateTimeImmutable(null, timezone_open("Europe/Paris")); -- cgit v1.2.3