| @@ 178-186 (lines=9) @@ | ||
| 175 | * |
|
| 176 | * @return IQueryBuilder |
|
| 177 | */ |
|
| 178 | protected function getGroupsDeleteSql($groupId) { |
|
| 179 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 180 | $expr = $qb->expr(); |
|
| 181 | ||
| 182 | $qb->delete(CoreRequestBuilder::TABLE_GROUPS) |
|
| 183 | ->where($expr->eq('group_id', $qb->createNamedParameter($groupId))); |
|
| 184 | ||
| 185 | return $qb; |
|
| 186 | } |
|
| 187 | ||
| 188 | /** |
|
| 189 | * Base of the Sql Delete request for Members |
|
| @@ 41-50 (lines=10) @@ | ||
| 38 | * |
|
| 39 | * @return IQueryBuilder |
|
| 40 | */ |
|
| 41 | protected function getSharesDeleteSql() { |
|
| 42 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 43 | $qb->delete(self::TABLE_FILE_SHARES); |
|
| 44 | $qb->where( |
|
| 45 | $qb->expr() |
|
| 46 | ->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE)) |
|
| 47 | ); |
|
| 48 | ||
| 49 | return $qb; |
|
| 50 | } |
|
| 51 | ||
| 52 | ||
| 53 | /** |
|
| @@ 107-116 (lines=10) @@ | ||
| 104 | * |
|
| 105 | * @return IQueryBuilder |
|
| 106 | */ |
|
| 107 | protected function getSharesUpdateSql($uniqueId) { |
|
| 108 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 109 | $qb->update(self::TABLE_SHARES) |
|
| 110 | ->where( |
|
| 111 | $qb->expr() |
|
| 112 | ->eq('unique_id', $qb->createNamedParameter((string)$uniqueId)) |
|
| 113 | ); |
|
| 114 | ||
| 115 | return $qb; |
|
| 116 | } |
|
| 117 | ||
| 118 | ||
| 119 | /** |
|
| @@ 343-352 (lines=10) @@ | ||
| 340 | * |
|
| 341 | * @return IQueryBuilder |
|
| 342 | */ |
|
| 343 | protected function getCirclesUpdateSql($uniqueId) { |
|
| 344 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 345 | $qb->update(self::TABLE_CIRCLES) |
|
| 346 | ->where( |
|
| 347 | $qb->expr() |
|
| 348 | ->eq('unique_id', $qb->createNamedParameter($uniqueId)) |
|
| 349 | ); |
|
| 350 | ||
| 351 | return $qb; |
|
| 352 | } |
|
| 353 | ||
| 354 | ||
| 355 | /** |
|
| @@ 362-376 (lines=15) @@ | ||
| 359 | * |
|
| 360 | * @return IQueryBuilder |
|
| 361 | */ |
|
| 362 | protected function getCirclesDeleteSql($circleUniqueId) { |
|
| 363 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 364 | $qb->delete(self::TABLE_CIRCLES) |
|
| 365 | ->where( |
|
| 366 | $qb->expr() |
|
| 367 | ->eq( |
|
| 368 | $qb->createFunction( |
|
| 369 | 'SUBSTR(`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')' |
|
| 370 | ), |
|
| 371 | $qb->createNamedParameter($circleUniqueId) |
|
| 372 | ) |
|
| 373 | ); |
|
| 374 | ||
| 375 | return $qb; |
|
| 376 | } |
|
| 377 | ||
| 378 | ||
| 379 | /** |
|
| @@ 529-537 (lines=9) @@ | ||
| 526 | * |
|
| 527 | * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
| 528 | */ |
|
| 529 | protected function getBaseDeleteSql() { |
|
| 530 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 531 | $expr = $qb->expr(); |
|
| 532 | ||
| 533 | $qb->delete('share') |
|
| 534 | ->where($expr->eq('share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE))); |
|
| 535 | ||
| 536 | return $qb; |
|
| 537 | } |
|
| 538 | ||
| 539 | ||
| 540 | /** |
|
| @@ 545-553 (lines=9) @@ | ||
| 542 | * |
|
| 543 | * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
| 544 | */ |
|
| 545 | protected function getBaseUpdateSql() { |
|
| 546 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 547 | $expr = $qb->expr(); |
|
| 548 | ||
| 549 | $qb->update('share') |
|
| 550 | ->where($expr->eq('share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE))); |
|
| 551 | ||
| 552 | return $qb; |
|
| 553 | } |
|
| 554 | } |
|
| 555 | ||