From 0ba5499ee6f1a8fa45718549140a8a0547a032ee Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Sun, 14 Jan 2018 09:09:01 -0100 Subject: save error message on index Signed-off-by: Maxence Lange --- lib/Model/Index.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'lib/Model') diff --git a/lib/Model/Index.php b/lib/Model/Index.php index 9924871..ca375d0 100644 --- a/lib/Model/Index.php +++ b/lib/Model/Index.php @@ -59,6 +59,9 @@ class Index implements \JsonSerializable { /** @var int */ private $err = 0; + /** @var string */ + private $message; + /** @var int */ private $lastIndex = 0; @@ -146,6 +149,7 @@ class Index implements \JsonSerializable { $this->status -= $status; } + /** * @param int $err * @@ -164,6 +168,34 @@ class Index implements \JsonSerializable { return $this->err; } + /** + * @return $this + */ + public function incrementError() { + $this->err++; + + return $this; + } + + + /** + * @return string + */ + public function getMessage() { + return $this->message; + } + + /** + * @param string $message + * + * @return Index + */ + public function setMessage($message) { + $this->message = $message; + + return $this; + } + /** * @param int $lastIndex -- cgit v1.2.3