Index: trunk/extensions/SecurePoll/includes/entities/Entity.php |
— | — | @@ -62,7 +62,7 @@ |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * Get the parent election |
66 | | - * @return Int |
| 66 | + * @return SecurePoll_Election |
67 | 67 | */ |
68 | 68 | public function getElection() { |
69 | 69 | return $this->electionId !== null |
Index: trunk/extensions/SecurePoll/includes/entities/Election.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | * Get the election's parent election... hmm... |
95 | 95 | */ |
96 | 96 | function getElection() { |
97 | | - return $this->id; |
| 97 | + return $this; |
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
Index: trunk/extensions/SecurePoll/includes/main/Store.php |
— | — | @@ -229,7 +229,7 @@ |
230 | 230 | return $questions; |
231 | 231 | } |
232 | 232 | |
233 | | - function callbackValidVotes( $electionId, $callback, $voterId=null ) { |
| 233 | + function callbackValidVotes( $electionId, $callback, $voterId = null ) { |
234 | 234 | $dbr = $this->getDB(); |
235 | 235 | $where = array( |
236 | 236 | 'vote_election' => $electionId, |
— | — | @@ -356,7 +356,7 @@ |
357 | 357 | } |
358 | 358 | |
359 | 359 | function getEntityType( $id ){ |
360 | | - return array_key_exists( $this->entityInfo[$id] ) |
| 360 | + return isset( $this->entityInfo[$id] ) |
361 | 361 | ? $this->entityInfo[$id]['type'] |
362 | 362 | : false; |
363 | 363 | } |
Index: trunk/extensions/SecurePoll/includes/main/Context.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | /** Get the type of a particular entity **/ |
100 | | - function getEntityType( $id ){ |
| 100 | + function getEntityType( $id ) { |
101 | 101 | return $this->getStore()->getEntityType( $id ); |
102 | 102 | } |
103 | 103 | |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | * false if it does not exist. |
107 | 107 | */ |
108 | 108 | function getElection( $id ) { |
109 | | - if( !isset( $this->electionCache[$id] ) ){ |
| 109 | + if( !isset( $this->electionCache[$id] ) ) { |
110 | 110 | $info = $this->getStore()->getElectionInfo( array( $id ) ); |
111 | 111 | if ( $info ) { |
112 | 112 | $this->electionCache[$id] = $this->newElection( reset( $info ) ); |