| @@ 244-258 (lines=15) @@ | ||
| 241 | * @return Index |
|
| 242 | * @throws IndexDoesNotExistException |
|
| 243 | */ |
|
| 244 | public function getIndex(string $providerId, string $documentId): Index { |
|
| 245 | $qb = $this->getIndexesSelectSql(); |
|
| 246 | $this->limitToProviderId($qb, $providerId); |
|
| 247 | $this->limitToDocumentId($qb, $documentId); |
|
| 248 | ||
| 249 | $cursor = $qb->execute(); |
|
| 250 | $data = $cursor->fetch(); |
|
| 251 | $cursor->closeCursor(); |
|
| 252 | ||
| 253 | if ($data === false) { |
|
| 254 | throw new IndexDoesNotExistException($this->l10n->t('Index not found')); |
|
| 255 | } |
|
| 256 | ||
| 257 | return $this->parseIndexesSelectSql($data); |
|
| 258 | } |
|
| 259 | ||
| 260 | ||
| 261 | /** |
|
| @@ 129-142 (lines=14) @@ | ||
| 126 | * @return Tick |
|
| 127 | * @throws TickDoesNotExistException |
|
| 128 | */ |
|
| 129 | public function getTickById(int $id): Tick { |
|
| 130 | $qb = $this->getTickSelectSql(); |
|
| 131 | $this->limitToId($qb, $id); |
|
| 132 | ||
| 133 | $cursor = $qb->execute(); |
|
| 134 | $data = $cursor->fetch(); |
|
| 135 | $cursor->closeCursor(); |
|
| 136 | ||
| 137 | if ($data === false) { |
|
| 138 | throw new TickDoesNotExistException($this->l10n->t('Tick not found')); |
|
| 139 | } |
|
| 140 | ||
| 141 | return $this->parseTickSelectSql($data); |
|
| 142 | } |
|
| 143 | ||
| 144 | ||
| 145 | /** |
|