Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsplitt3r <splitt3r@users.noreply.github.com>2017-11-08 11:27:51 +0300
committersplitt3r <splitt3r@users.noreply.github.com>2017-11-08 11:27:51 +0300
commit654da24f13a8ba55f493b9f9665012f44b8a753a (patch)
tree4251070db1b825e3f4f195a19efd560cfa59f193 /lib
parent7905d95e08ae4c177d6d0e9af930fc740177aaa8 (diff)
Added type casting to model classes
Diffstat (limited to 'lib')
-rw-r--r--lib/Db/Comment.php8
-rw-r--r--lib/Db/Date.php8
-rw-r--r--lib/Db/Event.php10
-rw-r--r--lib/Db/Notification.php8
-rw-r--r--lib/Db/Participation.php9
-rw-r--r--lib/Db/ParticipationText.php9
-rw-r--r--lib/Db/Text.php8
7 files changed, 60 insertions, 0 deletions
diff --git a/lib/Db/Comment.php b/lib/Db/Comment.php
index bbfb5403..add8c4dc 100644
--- a/lib/Db/Comment.php
+++ b/lib/Db/Comment.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -38,4 +39,11 @@ class Comment extends Model {
protected $dt;
protected $comment;
protected $pollId;
+
+ /**
+ * Comment constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ }
}
diff --git a/lib/Db/Date.php b/lib/Db/Date.php
index 5363ec6a..a4d9894d 100644
--- a/lib/Db/Date.php
+++ b/lib/Db/Date.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -32,4 +33,11 @@ namespace OCA\Polls\Db;
class Date extends Model {
protected $dt;
protected $pollId;
+
+ /**
+ * Date constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ }
}
diff --git a/lib/Db/Event.php b/lib/Db/Event.php
index f422f0b6..8a167495 100644
--- a/lib/Db/Event.php
+++ b/lib/Db/Event.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -56,4 +57,13 @@ class Event extends Model {
protected $hash;
protected $isAnonymous;
protected $fullAnonymous;
+
+ /**
+ * Event constructor.
+ */
+ public function __construct() {
+ $this->addType('type', 'integer');
+ $this->addType('isAnonymous', 'integer');
+ $this->addType('fullAnonymous', 'integer');
+ }
}
diff --git a/lib/Db/Notification.php b/lib/Db/Notification.php
index d5919551..55ebbb79 100644
--- a/lib/Db/Notification.php
+++ b/lib/Db/Notification.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -32,4 +33,11 @@ namespace OCA\Polls\Db;
class Notification extends Model {
protected $userId;
protected $pollId;
+
+ /**
+ * Notification constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ }
}
diff --git a/lib/Db/Participation.php b/lib/Db/Participation.php
index 317561dc..d22be610 100644
--- a/lib/Db/Participation.php
+++ b/lib/Db/Participation.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -38,4 +39,12 @@ class Participation extends Model {
protected $userId;
protected $pollId;
protected $type;
+
+ /**
+ * Participation constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ $this->addType('type', 'integer');
+ }
}
diff --git a/lib/Db/ParticipationText.php b/lib/Db/ParticipationText.php
index 064c50d3..83ef4b52 100644
--- a/lib/Db/ParticipationText.php
+++ b/lib/Db/ParticipationText.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -38,4 +39,12 @@ class ParticipationText extends Model {
protected $userId;
protected $pollId;
protected $type;
+
+ /**
+ * ParticipationText constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ $this->addType('type', 'integer');
+ }
}
diff --git a/lib/Db/Text.php b/lib/Db/Text.php
index c888dbdc..9ef423c2 100644
--- a/lib/Db/Text.php
+++ b/lib/Db/Text.php
@@ -3,6 +3,7 @@
* @copyright Copyright (c) 2017 Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
*
* @author Vinzenz Rosenkranz <vinzenz.rosenkranz@gmail.com>
+ * @author Kai Schröer <git@schroeer.co>
*
* @license GNU AGPL version 3 or any later version
*
@@ -32,4 +33,11 @@ namespace OCA\Polls\Db;
class Text extends Model {
protected $text;
protected $pollId;
+
+ /**
+ * Text constructor.
+ */
+ public function __construct() {
+ $this->addType('pollId', 'integer');
+ }
}