| @@ 518-526 (lines=9) @@ | ||
| 515 | * |
|
| 516 | * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
| 517 | */ |
|
| 518 | protected function getBaseDeleteSql() { |
|
| 519 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 520 | $expr = $qb->expr(); |
|
| 521 | ||
| 522 | $qb->delete('share') |
|
| 523 | ->where($expr->eq('share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE))); |
|
| 524 | ||
| 525 | return $qb; |
|
| 526 | } |
|
| 527 | ||
| 528 | ||
| 529 | /** |
|
| @@ 534-542 (lines=9) @@ | ||
| 531 | * |
|
| 532 | * @return \OCP\DB\QueryBuilder\IQueryBuilder |
|
| 533 | */ |
|
| 534 | protected function getBaseUpdateSql() { |
|
| 535 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 536 | $expr = $qb->expr(); |
|
| 537 | ||
| 538 | $qb->update('share') |
|
| 539 | ->where($expr->eq('share_type', $qb->createNamedParameter(Share::SHARE_TYPE_CIRCLE))); |
|
| 540 | ||
| 541 | return $qb; |
|
| 542 | } |
|
| 543 | } |
|
| 544 | ||
| @@ 335-344 (lines=10) @@ | ||
| 332 | * |
|
| 333 | * @return IQueryBuilder |
|
| 334 | */ |
|
| 335 | protected function getCirclesUpdateSql($uniqueId) { |
|
| 336 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 337 | $qb->update(self::TABLE_CIRCLES) |
|
| 338 | ->where( |
|
| 339 | $qb->expr() |
|
| 340 | ->eq('unique_id', $qb->createNamedParameter($uniqueId)) |
|
| 341 | ); |
|
| 342 | ||
| 343 | return $qb; |
|
| 344 | } |
|
| 345 | ||
| 346 | ||
| 347 | /** |
|
| @@ 354-368 (lines=15) @@ | ||
| 351 | * |
|
| 352 | * @return IQueryBuilder |
|
| 353 | */ |
|
| 354 | protected function getCirclesDeleteSql($circleUniqueId) { |
|
| 355 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 356 | $qb->delete(self::TABLE_CIRCLES) |
|
| 357 | ->where( |
|
| 358 | $qb->expr() |
|
| 359 | ->eq( |
|
| 360 | $qb->createFunction( |
|
| 361 | 'SUBSTR(`unique_id`, 1, ' . Circle::SHORT_UNIQUE_ID_LENGTH . ')' |
|
| 362 | ), |
|
| 363 | $qb->createNamedParameter($circleUniqueId) |
|
| 364 | ) |
|
| 365 | ); |
|
| 366 | ||
| 367 | return $qb; |
|
| 368 | } |
|
| 369 | ||
| 370 | ||
| 371 | /** |
|
| @@ 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 |
|
| @@ 108-117 (lines=10) @@ | ||
| 105 | * |
|
| 106 | * @return IQueryBuilder |
|
| 107 | */ |
|
| 108 | protected function getSharesUpdateSql($uniqueId) { |
|
| 109 | $qb = $this->dbConnection->getQueryBuilder(); |
|
| 110 | $qb->update(self::TABLE_SHARES) |
|
| 111 | ->where( |
|
| 112 | $qb->expr() |
|
| 113 | ->eq('unique_id', $qb->createNamedParameter((string)$uniqueId)) |
|
| 114 | ); |
|
| 115 | ||
| 116 | return $qb; |
|
| 117 | } |
|
| 118 | ||
| 119 | ||
| 120 | /** |
|
| @@ 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 | } |
|