@@ -236,12 +236,12 @@ |
||
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | /** |
| 239 | - * Read all votes of a poll based on the poll id |
|
| 240 | - * @NoAdminRequired |
|
| 241 | - * @NoCSRFRequired |
|
| 242 | - * @param Integer $pollId |
|
| 243 | - * @return Array |
|
| 244 | - */ |
|
| 239 | + * Read all votes of a poll based on the poll id |
|
| 240 | + * @NoAdminRequired |
|
| 241 | + * @NoCSRFRequired |
|
| 242 | + * @param Integer $pollId |
|
| 243 | + * @return Array |
|
| 244 | + */ |
|
| 245 | 245 | public function getVotes($pollId, $anonymize = true) { |
| 246 | 246 | $currentUser = \OC::$server->getUserSession()->getUser()->getUID(); |
| 247 | 247 | $votes = $this->voteMapper->findByPoll($pollId); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @return Boolean |
| 134 | 134 | */ |
| 135 | 135 | private function checkUserAccess($accessList) { |
| 136 | - foreach ($accessList as $accessItem ) { |
|
| 136 | + foreach ($accessList as $accessItem) { |
|
| 137 | 137 | if ($accessItem['type'] === 'user' && $accessItem['id'] === \OC::$server->getUserSession()->getUser()->getUID()) { |
| 138 | 138 | return true; |
| 139 | 139 | } |
@@ -148,8 +148,8 @@ discard block |
||
| 148 | 148 | * @return Boolean |
| 149 | 149 | */ |
| 150 | 150 | private function checkGroupAccess($accessList) { |
| 151 | - foreach ($accessList as $accessItem ) { |
|
| 152 | - if ($accessItem['type'] === 'group' && $this->groupManager->isInGroup(\OC::$server->getUserSession()->getUser()->getUID(),$accessItem['id'])) { |
|
| 151 | + foreach ($accessList as $accessItem) { |
|
| 152 | + if ($accessItem['type'] === 'group' && $this->groupManager->isInGroup(\OC::$server->getUserSession()->getUser()->getUID(), $accessItem['id'])) { |
|
| 153 | 153 | return true; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | |
| 223 | 223 | foreach ($votes as $element) { |
| 224 | 224 | if (!array_key_exists($element->getUserId(), $anonList)) { |
| 225 | - $anonList[$element->getUserId()] = 'Anonymous ' . ++$i ; |
|
| 225 | + $anonList[$element->getUserId()] = 'Anonymous ' . ++$i; |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | foreach ($votes as $element) { |
| 91 | 91 | if (!array_key_exists($element->getUserId(), $anonList)) { |
| 92 | - $anonList[$element->getUserId()] = 'Anonymous ' . ++$i ; |
|
| 92 | + $anonList[$element->getUserId()] = 'Anonymous ' . ++$i; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -47,13 +47,13 @@ discard block |
||
| 47 | 47 | public function find($id) { |
| 48 | 48 | $qb = $this->db->getQueryBuilder(); |
| 49 | 49 | |
| 50 | - $qb->select('*') |
|
| 51 | - ->from($this->getTableName()) |
|
| 52 | - ->where( |
|
| 53 | - $qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)) |
|
| 54 | - ); |
|
| 50 | + $qb->select('*') |
|
| 51 | + ->from($this->getTableName()) |
|
| 52 | + ->where( |
|
| 53 | + $qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT)) |
|
| 54 | + ); |
|
| 55 | 55 | |
| 56 | - return $this->findEntity($qb); |
|
| 56 | + return $this->findEntity($qb); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | public function findByHash($hash) { |
| 66 | 66 | $qb = $this->db->getQueryBuilder(); |
| 67 | 67 | |
| 68 | - $qb->select('*') |
|
| 69 | - ->from($this->getTableName()) |
|
| 70 | - ->where( |
|
| 71 | - $qb->expr()->eq('hash', $qb->createNamedParameter($hash, IQueryBuilder::PARAM_STR)) |
|
| 72 | - ); |
|
| 68 | + $qb->select('*') |
|
| 69 | + ->from($this->getTableName()) |
|
| 70 | + ->where( |
|
| 71 | + $qb->expr()->eq('hash', $qb->createNamedParameter($hash, IQueryBuilder::PARAM_STR)) |
|
| 72 | + ); |
|
| 73 | 73 | |
| 74 | 74 | try { |
| 75 | 75 | return $this->findEntity($qb); |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | public function findAll() { |
| 86 | 86 | $qb = $this->db->getQueryBuilder(); |
| 87 | 87 | |
| 88 | - $qb->select('*') |
|
| 89 | - ->from($this->getTableName()); |
|
| 88 | + $qb->select('*') |
|
| 89 | + ->from($this->getTableName()); |
|
| 90 | 90 | |
| 91 | - return $this->findEntities($qb); |
|
| 91 | + return $this->findEntities($qb); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | } |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | ->where( |
| 74 | 74 | $qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT)) |
| 75 | 75 | ) |
| 76 | - ->andWhere( |
|
| 77 | - $qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)) |
|
| 78 | - ); |
|
| 76 | + ->andWhere( |
|
| 77 | + $qb->expr()->eq('user_id', $qb->createNamedParameter($userId, IQueryBuilder::PARAM_STR)) |
|
| 78 | + ); |
|
| 79 | 79 | |
| 80 | 80 | return $this->findEntity($qb); |
| 81 | 81 | } |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | ->where( |
| 92 | 92 | $qb->expr()->eq('poll_id', $qb->createNamedParameter($pollId, IQueryBuilder::PARAM_INT)) |
| 93 | 93 | ) |
| 94 | - ->andWhere( |
|
| 95 | - $qb->expr()->eq('user_id', $qb->createNamedParameter($currentUser, IQueryBuilder::PARAM_STR)) |
|
| 96 | - ); |
|
| 94 | + ->andWhere( |
|
| 95 | + $qb->expr()->eq('user_id', $qb->createNamedParameter($currentUser, IQueryBuilder::PARAM_STR)) |
|
| 96 | + ); |
|
| 97 | 97 | |
| 98 | 98 | $qb->execute(); |
| 99 | 99 | } |