@@ -28,50 +28,50 @@ |
||
| 28 | 28 | |
| 29 | 29 | class ParticipationTextMapper extends Mapper { |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * ParticipationTextMapper constructor. |
|
| 33 | - * @param IDBConnection $db |
|
| 34 | - */ |
|
| 35 | - public function __construct(IDBConnection $db) { |
|
| 36 | - parent::__construct($db, 'polls_particip_text', '\OCA\Polls\Db\ParticipationText'); |
|
| 37 | - } |
|
| 31 | + /** |
|
| 32 | + * ParticipationTextMapper constructor. |
|
| 33 | + * @param IDBConnection $db |
|
| 34 | + */ |
|
| 35 | + public function __construct(IDBConnection $db) { |
|
| 36 | + parent::__construct($db, 'polls_particip_text', '\OCA\Polls\Db\ParticipationText'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @param string $pollId |
|
| 41 | - * @param int $limit |
|
| 42 | - * @param int $offset |
|
| 43 | - * @return ParticipationText[] |
|
| 44 | - */ |
|
| 45 | - public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 46 | - $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 47 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 48 | - } |
|
| 39 | + /** |
|
| 40 | + * @param string $pollId |
|
| 41 | + * @param int $limit |
|
| 42 | + * @param int $offset |
|
| 43 | + * @return ParticipationText[] |
|
| 44 | + */ |
|
| 45 | + public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 46 | + $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 47 | + return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @param string $userId |
|
| 52 | - * @param int $limit |
|
| 53 | - * @param int $offset |
|
| 54 | - * @return ParticipationText[] |
|
| 55 | - */ |
|
| 56 | - public function findDistinctByUser($userId, $limit = null, $offset = null) { |
|
| 57 | - $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
|
| 58 | - return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 59 | - } |
|
| 50 | + /** |
|
| 51 | + * @param string $userId |
|
| 52 | + * @param int $limit |
|
| 53 | + * @param int $offset |
|
| 54 | + * @return ParticipationText[] |
|
| 55 | + */ |
|
| 56 | + public function findDistinctByUser($userId, $limit = null, $offset = null) { |
|
| 57 | + $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
|
| 58 | + return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @param string $pollId |
|
| 63 | - */ |
|
| 64 | - public function deleteByPoll($pollId) { |
|
| 65 | - $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 66 | - $this->execute($sql, [$pollId]); |
|
| 67 | - } |
|
| 61 | + /** |
|
| 62 | + * @param string $pollId |
|
| 63 | + */ |
|
| 64 | + public function deleteByPoll($pollId) { |
|
| 65 | + $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 66 | + $this->execute($sql, [$pollId]); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * @param string $pollId |
|
| 71 | - * @param string $userId |
|
| 72 | - */ |
|
| 73 | - public function deleteByPollAndUser($pollId, $userId) { |
|
| 74 | - $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?'; |
|
| 75 | - $this->execute($sql, [$pollId, $userId]); |
|
| 76 | - } |
|
| 69 | + /** |
|
| 70 | + * @param string $pollId |
|
| 71 | + * @param string $userId |
|
| 72 | + */ |
|
| 73 | + public function deleteByPollAndUser($pollId, $userId) { |
|
| 74 | + $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?'; |
|
| 75 | + $this->execute($sql, [$pollId, $userId]); |
|
| 76 | + } |
|
| 77 | 77 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function findByPoll($pollId, $limit = null, $offset = null) { |
| 46 | 46 | $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
| 47 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 47 | + return $this->findEntities($sql, [ $pollId ], $limit, $offset); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function findDistinctByUser($userId, $limit = null, $offset = null) { |
| 57 | 57 | $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
| 58 | - return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 58 | + return $this->findEntities($sql, [ $userId ], $limit, $offset); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function deleteByPoll($pollId) { |
| 65 | 65 | $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
| 66 | - $this->execute($sql, [$pollId]); |
|
| 66 | + $this->execute($sql, [ $pollId ]); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -72,6 +72,6 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public function deleteByPollAndUser($pollId, $userId) { |
| 74 | 74 | $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ? AND user_id = ?'; |
| 75 | - $this->execute($sql, [$pollId, $userId]); |
|
| 75 | + $this->execute($sql, [ $pollId, $userId ]); |
|
| 76 | 76 | } |
| 77 | 77 | } |
@@ -28,30 +28,30 @@ |
||
| 28 | 28 | |
| 29 | 29 | class DateMapper extends Mapper { |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * DateMapper constructor. |
|
| 33 | - * @param IDBConnection $db |
|
| 34 | - */ |
|
| 35 | - public function __construct(IDBConnection $db) { |
|
| 36 | - parent::__construct($db, 'polls_dts', '\OCA\Polls\Db\Date'); |
|
| 37 | - } |
|
| 31 | + /** |
|
| 32 | + * DateMapper constructor. |
|
| 33 | + * @param IDBConnection $db |
|
| 34 | + */ |
|
| 35 | + public function __construct(IDBConnection $db) { |
|
| 36 | + parent::__construct($db, 'polls_dts', '\OCA\Polls\Db\Date'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @param string $pollId |
|
| 41 | - * @param int $limit |
|
| 42 | - * @param int $offset |
|
| 43 | - * @return Date[] |
|
| 44 | - */ |
|
| 45 | - public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 46 | - $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 47 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 48 | - } |
|
| 39 | + /** |
|
| 40 | + * @param string $pollId |
|
| 41 | + * @param int $limit |
|
| 42 | + * @param int $offset |
|
| 43 | + * @return Date[] |
|
| 44 | + */ |
|
| 45 | + public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 46 | + $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 47 | + return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @param string $pollId |
|
| 52 | - */ |
|
| 53 | - public function deleteByPoll($pollId) { |
|
| 54 | - $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 55 | - $this->execute($sql, [$pollId]); |
|
| 56 | - } |
|
| 50 | + /** |
|
| 51 | + * @param string $pollId |
|
| 52 | + */ |
|
| 53 | + public function deleteByPoll($pollId) { |
|
| 54 | + $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 55 | + $this->execute($sql, [$pollId]); |
|
| 56 | + } |
|
| 57 | 57 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function findByPoll($pollId, $limit = null, $offset = null) { |
| 46 | 46 | $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
| 47 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 47 | + return $this->findEntities($sql, [ $pollId ], $limit, $offset); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -52,6 +52,6 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function deleteByPoll($pollId) { |
| 54 | 54 | $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
| 55 | - $this->execute($sql, [$pollId]); |
|
| 55 | + $this->execute($sql, [ $pollId ]); |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -28,41 +28,41 @@ |
||
| 28 | 28 | |
| 29 | 29 | class CommentMapper extends Mapper { |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * CommentMapper constructor. |
|
| 33 | - * @param IDBConnection $db |
|
| 34 | - */ |
|
| 35 | - public function __construct(IDBConnection $db) { |
|
| 36 | - parent::__construct($db, 'polls_comments', '\OCA\Polls\Db\Comment'); |
|
| 37 | - } |
|
| 31 | + /** |
|
| 32 | + * CommentMapper constructor. |
|
| 33 | + * @param IDBConnection $db |
|
| 34 | + */ |
|
| 35 | + public function __construct(IDBConnection $db) { |
|
| 36 | + parent::__construct($db, 'polls_comments', '\OCA\Polls\Db\Comment'); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @param string $userId |
|
| 41 | - * @param int $limit |
|
| 42 | - * @param int $offset |
|
| 43 | - * @return Comment[] |
|
| 44 | - */ |
|
| 45 | - public function findDistinctByUser($userId, $limit = null, $offset = null) { |
|
| 46 | - $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
|
| 47 | - return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 48 | - } |
|
| 39 | + /** |
|
| 40 | + * @param string $userId |
|
| 41 | + * @param int $limit |
|
| 42 | + * @param int $offset |
|
| 43 | + * @return Comment[] |
|
| 44 | + */ |
|
| 45 | + public function findDistinctByUser($userId, $limit = null, $offset = null) { |
|
| 46 | + $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
|
| 47 | + return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 48 | + } |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * @param string $pollId |
|
| 52 | - * @param int $limit |
|
| 53 | - * @param int $offset |
|
| 54 | - * @return Comment[] |
|
| 55 | - */ |
|
| 56 | - public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 57 | - $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ? ORDER BY Dt DESC'; |
|
| 58 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 59 | - } |
|
| 50 | + /** |
|
| 51 | + * @param string $pollId |
|
| 52 | + * @param int $limit |
|
| 53 | + * @param int $offset |
|
| 54 | + * @return Comment[] |
|
| 55 | + */ |
|
| 56 | + public function findByPoll($pollId, $limit = null, $offset = null) { |
|
| 57 | + $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ? ORDER BY Dt DESC'; |
|
| 58 | + return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @param string $pollId |
|
| 63 | - */ |
|
| 64 | - public function deleteByPoll($pollId) { |
|
| 65 | - $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 66 | - $this->execute($sql, [$pollId]); |
|
| 67 | - } |
|
| 61 | + /** |
|
| 62 | + * @param string $pollId |
|
| 63 | + */ |
|
| 64 | + public function deleteByPoll($pollId) { |
|
| 65 | + $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
|
| 66 | + $this->execute($sql, [$pollId]); |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function findDistinctByUser($userId, $limit = null, $offset = null) { |
| 46 | 46 | $sql = 'SELECT DISTINCT * FROM ' . $this->getTableName() . ' WHERE user_id = ?'; |
| 47 | - return $this->findEntities($sql, [$userId], $limit, $offset); |
|
| 47 | + return $this->findEntities($sql, [ $userId ], $limit, $offset); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function findByPoll($pollId, $limit = null, $offset = null) { |
| 57 | 57 | $sql = 'SELECT * FROM ' . $this->getTableName() . ' WHERE poll_id = ? ORDER BY Dt DESC'; |
| 58 | - return $this->findEntities($sql, [$pollId], $limit, $offset); |
|
| 58 | + return $this->findEntities($sql, [ $pollId ], $limit, $offset); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -63,6 +63,6 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function deleteByPoll($pollId) { |
| 65 | 65 | $sql = 'DELETE FROM ' . $this->getTableName() . ' WHERE poll_id = ?'; |
| 66 | - $this->execute($sql, [$pollId]); |
|
| 66 | + $this->execute($sql, [ $pollId ]); |
|
| 67 | 67 | } |
| 68 | 68 | } |
@@ -1,27 +1,27 @@ |
||
| 1 | 1 | <?php |
| 2 | - /** |
|
| 3 | - * @copyright Copyright (c) 2017 Vinzenz Rosenkranz <[email protected]> |
|
| 4 | - * |
|
| 5 | - * @author Vinzenz Rosenkranz <[email protected]> |
|
| 6 | - * |
|
| 7 | - * @license GNU AGPL version 3 or any later version |
|
| 8 | - * |
|
| 9 | - * This program is free software: you can redistribute it and/or modify |
|
| 10 | - * it under the terms of the GNU Affero General Public License as |
|
| 11 | - * published by the Free Software Foundation, either version 3 of the |
|
| 12 | - * License, or (at your option) any later version. |
|
| 13 | - * |
|
| 14 | - * This program is distributed in the hope that it will be useful, |
|
| 15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 | - * GNU Affero General Public License for more details. |
|
| 18 | - * |
|
| 19 | - * You should have received a copy of the GNU Affero General Public License |
|
| 20 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 | - * |
|
| 22 | - */ |
|
| 2 | + /** |
|
| 3 | + * @copyright Copyright (c) 2017 Vinzenz Rosenkranz <[email protected]> |
|
| 4 | + * |
|
| 5 | + * @author Vinzenz Rosenkranz <[email protected]> |
|
| 6 | + * |
|
| 7 | + * @license GNU AGPL version 3 or any later version |
|
| 8 | + * |
|
| 9 | + * This program is free software: you can redistribute it and/or modify |
|
| 10 | + * it under the terms of the GNU Affero General Public License as |
|
| 11 | + * published by the Free Software Foundation, either version 3 of the |
|
| 12 | + * License, or (at your option) any later version. |
|
| 13 | + * |
|
| 14 | + * This program is distributed in the hope that it will be useful, |
|
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 17 | + * GNU Affero General Public License for more details. |
|
| 18 | + * |
|
| 19 | + * You should have received a copy of the GNU Affero General Public License |
|
| 20 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
| 21 | + * |
|
| 22 | + */ |
|
| 23 | 23 | |
| 24 | - \OCP\Util::addStyle('polls', 'main'); |
|
| 24 | + \OCP\Util::addStyle('polls', 'main'); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div id="app"> |
| 27 | 27 | <div id="app-content"> |
@@ -34,8 +34,8 @@ |
||
| 34 | 34 | * @method void setPollId(integer $value) |
| 35 | 35 | */ |
| 36 | 36 | class Comment extends Model { |
| 37 | - protected $userId; |
|
| 38 | - protected $dt; |
|
| 39 | - protected $comment; |
|
| 40 | - protected $pollId; |
|
| 37 | + protected $userId; |
|
| 38 | + protected $dt; |
|
| 39 | + protected $comment; |
|
| 40 | + protected $pollId; |
|
| 41 | 41 | } |
@@ -30,6 +30,6 @@ |
||
| 30 | 30 | * @method void setPollId(integer $value) |
| 31 | 31 | */ |
| 32 | 32 | class Date extends Model { |
| 33 | - protected $dt; |
|
| 34 | - protected $pollId; |
|
| 33 | + protected $dt; |
|
| 34 | + protected $pollId; |
|
| 35 | 35 | } |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | * @param $value |
| 35 | 35 | */ |
| 36 | 36 | public function __set($name, $value) { |
| 37 | - $this->setter($name, [$value]); |
|
| 37 | + $this->setter($name, [ $value ]); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | use OCP\AppFramework\Db\Entity; |
| 27 | 27 | |
| 28 | 28 | abstract class Model extends Entity { |
| 29 | - /** |
|
| 30 | - * FactoryMuffin checks for the existence of setters with method_exists($obj, $attr) but that returns false. |
|
| 31 | - * By overwriting the __set() magic method we can trigger the changed flag on $obj->attr assignment. |
|
| 32 | - * |
|
| 33 | - * @param $name |
|
| 34 | - * @param $value |
|
| 35 | - */ |
|
| 36 | - public function __set($name, $value) { |
|
| 37 | - $this->setter($name, [$value]); |
|
| 38 | - } |
|
| 29 | + /** |
|
| 30 | + * FactoryMuffin checks for the existence of setters with method_exists($obj, $attr) but that returns false. |
|
| 31 | + * By overwriting the __set() magic method we can trigger the changed flag on $obj->attr assignment. |
|
| 32 | + * |
|
| 33 | + * @param $name |
|
| 34 | + * @param $value |
|
| 35 | + */ |
|
| 36 | + public function __set($name, $value) { |
|
| 37 | + $this->setter($name, [$value]); |
|
| 38 | + } |
|
| 39 | 39 | } |
@@ -46,14 +46,14 @@ |
||
| 46 | 46 | * @method void setFullAnonymous(integer $value) |
| 47 | 47 | */ |
| 48 | 48 | class Event extends Model { |
| 49 | - protected $type; |
|
| 50 | - protected $title; |
|
| 51 | - protected $description; |
|
| 52 | - protected $owner; |
|
| 53 | - protected $created; |
|
| 54 | - protected $access; |
|
| 55 | - protected $expire; |
|
| 56 | - protected $hash; |
|
| 57 | - protected $isAnonymous; |
|
| 58 | - protected $fullAnonymous; |
|
| 49 | + protected $type; |
|
| 50 | + protected $title; |
|
| 51 | + protected $description; |
|
| 52 | + protected $owner; |
|
| 53 | + protected $created; |
|
| 54 | + protected $access; |
|
| 55 | + protected $expire; |
|
| 56 | + protected $hash; |
|
| 57 | + protected $isAnonymous; |
|
| 58 | + protected $fullAnonymous; |
|
| 59 | 59 | } |
@@ -34,8 +34,8 @@ |
||
| 34 | 34 | * @method void setType(integer $value) |
| 35 | 35 | */ |
| 36 | 36 | class Participation extends Model { |
| 37 | - protected $dt; |
|
| 38 | - protected $userId; |
|
| 39 | - protected $pollId; |
|
| 40 | - protected $type; |
|
| 37 | + protected $dt; |
|
| 38 | + protected $userId; |
|
| 39 | + protected $pollId; |
|
| 40 | + protected $type; |
|
| 41 | 41 | } |