| @@ 51-63 (lines=13) @@ | ||
| 48 | * @return SharesToken |
|
| 49 | * @throws TokenDoesNotExistException |
|
| 50 | */ |
|
| 51 | public function getByToken(string $token) { |
|
| 52 | $qb = $this->getTokensSelectSql(); |
|
| 53 | $this->limitToToken($qb, $token); |
|
| 54 | ||
| 55 | $cursor = $qb->execute(); |
|
| 56 | $data = $cursor->fetch(); |
|
| 57 | $cursor->closeCursor(); |
|
| 58 | if ($data === false) { |
|
| 59 | throw new TokenDoesNotExistException('Unknown share token'); |
|
| 60 | } |
|
| 61 | ||
| 62 | return $this->parseTokensSelectSql($data); |
|
| 63 | } |
|
| 64 | ||
| 65 | ||
| 66 | /** |
|
| @@ 474-488 (lines=15) @@ | ||
| 471 | * @return Share |
|
| 472 | * @throws ShareNotFound |
|
| 473 | */ |
|
| 474 | public function getShareById($shareId, $recipientId = null) { |
|
| 475 | $qb = $this->getBaseSelectSql(); |
|
| 476 | ||
| 477 | $this->limitToShare($qb, $shareId); |
|
| 478 | ||
| 479 | $cursor = $qb->execute(); |
|
| 480 | $data = $cursor->fetch(); |
|
| 481 | $cursor->closeCursor(); |
|
| 482 | ||
| 483 | if ($data === false) { |
|
| 484 | throw new ShareNotFound(); |
|
| 485 | } |
|
| 486 | ||
| 487 | return $this->createShareObject($data); |
|
| 488 | } |
|
| 489 | ||
| 490 | ||
| 491 | /** |
|