| @@ 217-224 (lines=8) @@ | ||
| 214 | * @param string $streamId |
|
| 215 | * @return int |
|
| 216 | */ |
|
| 217 | protected function streamVersion($streamId) |
|
| 218 | { |
|
| 219 | $stmt = $this->connection |
|
| 220 | ->prepare('SELECT COUNT(*) FROM events WHERE stream_id = :streamId'); |
|
| 221 | $stmt->bindValue(':streamId', $streamId); |
|
| 222 | $stmt->execute(); |
|
| 223 | return intval($stmt->fetchColumn()); |
|
| 224 | } |
|
| 225 | ||
| 226 | /** |
|
| 227 | * @param string $streamId |
|
| @@ 253-260 (lines=8) @@ | ||
| 250 | * @param string $streamId |
|
| 251 | * @return bool |
|
| 252 | */ |
|
| 253 | protected function streamExists($streamId) |
|
| 254 | { |
|
| 255 | $stmt = $this->connection |
|
| 256 | ->prepare('SELECT COUNT(*) FROM streams WHERE id = :streamId'); |
|
| 257 | $stmt->bindValue(':streamId', $streamId); |
|
| 258 | $stmt->execute(); |
|
| 259 | return boolval($stmt->fetchColumn()); |
|
| 260 | } |
|
| 261 | ||
| 262 | /** |
|
| 263 | * Initialize the Event Store |
|
| @@ 192-199 (lines=8) @@ | ||
| 189 | * @param string $streamId |
|
| 190 | * @return bool |
|
| 191 | */ |
|
| 192 | protected function streamExists($streamId) |
|
| 193 | { |
|
| 194 | $stmt = $this->connection |
|
| 195 | ->prepare('SELECT COUNT(*) FROM streams WHERE id = :streamId'); |
|
| 196 | $stmt->bindValue(':streamId', $streamId); |
|
| 197 | $stmt->execute(); |
|
| 198 | return boolval($stmt->fetchColumn()); |
|
| 199 | } |
|
| 200 | /** |
|
| 201 | * @param string $streamId |
|
| 202 | * @return int |
|
| @@ 204-211 (lines=8) @@ | ||
| 201 | * @param string $streamId |
|
| 202 | * @return int |
|
| 203 | */ |
|
| 204 | protected function streamVersion($streamId) |
|
| 205 | { |
|
| 206 | $stmt = $this->connection |
|
| 207 | ->prepare('SELECT COUNT(*) FROM events WHERE stream_id = :streamId'); |
|
| 208 | $stmt->bindValue(':streamId', $streamId); |
|
| 209 | $stmt->execute(); |
|
| 210 | return intval($stmt->fetchColumn()); |
|
| 211 | } |
|
| 212 | ||
| 213 | /** |
|
| 214 | * @param string $type |
|