| @@ 208-215 (lines=8) @@ | ||
| 205 | * @param string $streamId |
|
| 206 | * @return int |
|
| 207 | */ |
|
| 208 | protected function streamVersion($streamId) |
|
| 209 | { |
|
| 210 | $stmt = $this->connection |
|
| 211 | ->prepare('SELECT COUNT(*) FROM events WHERE stream_id = :streamId'); |
|
| 212 | $stmt->bindValue(':streamId', $streamId); |
|
| 213 | $stmt->execute(); |
|
| 214 | return intval($stmt->fetchColumn()); |
|
| 215 | } |
|
| 216 | ||
| 217 | /** |
|
| 218 | * @param string $streamId |
|
| @@ 221-228 (lines=8) @@ | ||
| 218 | * @param string $streamId |
|
| 219 | * @return bool |
|
| 220 | */ |
|
| 221 | protected function streamExists($streamId) |
|
| 222 | { |
|
| 223 | $stmt = $this->connection |
|
| 224 | ->prepare('SELECT COUNT(*) FROM streams WHERE id = :streamId'); |
|
| 225 | $stmt->bindValue(':streamId', $streamId); |
|
| 226 | $stmt->execute(); |
|
| 227 | return boolval($stmt->fetchColumn()); |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * Initialize the Event Store |
|
| @@ 183-190 (lines=8) @@ | ||
| 180 | * @param string $streamId |
|
| 181 | * @return bool |
|
| 182 | */ |
|
| 183 | protected function streamExists($streamId) |
|
| 184 | { |
|
| 185 | $stmt = $this->connection |
|
| 186 | ->prepare('SELECT COUNT(*) FROM streams WHERE id = :streamId'); |
|
| 187 | $stmt->bindValue(':streamId', $streamId); |
|
| 188 | $stmt->execute(); |
|
| 189 | return boolval($stmt->fetchColumn()); |
|
| 190 | } |
|
| 191 | /** |
|
| 192 | * @param string $streamId |
|
| 193 | * @return int |
|
| @@ 195-202 (lines=8) @@ | ||
| 192 | * @param string $streamId |
|
| 193 | * @return int |
|
| 194 | */ |
|
| 195 | protected function streamVersion($streamId) |
|
| 196 | { |
|
| 197 | $stmt = $this->connection |
|
| 198 | ->prepare('SELECT COUNT(*) FROM events WHERE stream_id = :streamId'); |
|
| 199 | $stmt->bindValue(':streamId', $streamId); |
|
| 200 | $stmt->execute(); |
|
| 201 | return intval($stmt->fetchColumn()); |
|
| 202 | } |
|
| 203 | ||
| 204 | /** |
|
| 205 | * @param string $type |
|