From 8ac5a09605992f1e434cb793ceca7497c6f46d23 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Wed, 30 Jan 2019 21:15:17 +0100 Subject: feat: editBy to store the current editor of an art --- app/class/art2.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'app/class/art2.php') diff --git a/app/class/art2.php b/app/class/art2.php index 7354e8c..4f04858 100644 --- a/app/class/art2.php +++ b/app/class/art2.php @@ -39,6 +39,7 @@ class Art2 protected $affcount; protected $visitcount; protected $editcount; + protected $editby; const LEN = 255; @@ -110,6 +111,7 @@ class Art2 $this->setaffcount(0); $this->setvisitcount(0); $this->seteditcount(0); + $this->seteditby([]); } @@ -441,6 +443,10 @@ class Art2 return $this->editcount; } + public function editby($type = 'array') + { + return $this->editby; + } @@ -761,6 +767,13 @@ class Art2 } } + public function seteditby($editby) + { + if(is_array($editby)) { + $this->editby = $editby; + } + } + // __________________________________ C O U N T E R S ______________________________ @@ -794,6 +807,21 @@ class Art2 } } + public function addeditby(string $id) + { + $this->editby[$id] = true; + } + + public function removeeditby(string $id) + { + unset($this->editby[$id]); + } + + public function iseditedby() + { + return count($this->editby) > 0; + } + } -- cgit v1.2.3